diff options
author | 2002-12-20 22:25:59 +0000 | |
---|---|---|
committer | 2002-12-20 22:25:59 +0000 | |
commit | b6fd085334a317e16902be716e24d5f2d14b2ba2 (patch) | |
tree | da7511999790a4dbdee9880164cfed866275aa5e /usr.sbin/tcpdump/print-pfsync.c | |
parent | replace struct assignment w/ bcopy w/ help and testing of millert@; henning@ ok; fixes unaligned trap on alpha from pr3037 (diff) | |
download | wireguard-openbsd-b6fd085334a317e16902be716e24d5f2d14b2ba2.tar.xz wireguard-openbsd-b6fd085334a317e16902be716e24d5f2d14b2ba2.zip |
use bcopy instead of struct assignment
Diffstat (limited to 'usr.sbin/tcpdump/print-pfsync.c')
-rw-r--r-- | usr.sbin/tcpdump/print-pfsync.c | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/usr.sbin/tcpdump/print-pfsync.c b/usr.sbin/tcpdump/print-pfsync.c index 8f0870d8ebe..6875544261e 100644 --- a/usr.sbin/tcpdump/print-pfsync.c +++ b/usr.sbin/tcpdump/print-pfsync.c @@ -1,4 +1,4 @@ -/* $OpenBSD: print-pfsync.c,v 1.3 2002/11/30 13:56:23 mickey Exp $ */ +/* $OpenBSD: print-pfsync.c,v 1.4 2002/12/20 22:25:59 mickey Exp $ */ /* * Copyright (c) 2002 Michael Shalayeff @@ -28,7 +28,7 @@ #ifndef lint static const char rcsid[] = - "@(#) $Header: /home/cvs/src/usr.sbin/tcpdump/print-pfsync.c,v 1.3 2002/11/30 13:56:23 mickey Exp $"; + "@(#) $Header: /home/cvs/src/usr.sbin/tcpdump/print-pfsync.c,v 1.4 2002/12/20 22:25:59 mickey Exp $"; #endif #include <sys/param.h> @@ -55,6 +55,7 @@ struct rtentry; #include <pcap.h> #include <signal.h> #include <stdio.h> +#include <string.h> #include "interface.h" #include "addrtoname.h" @@ -104,13 +105,13 @@ pfsync_if_print(u_char *user, const struct pcap_pkthdr *h, i++, s++) { struct pf_state st; - st.lan = s->lan; NTOHS(st.lan.port); - st.gwy = s->gwy; NTOHS(st.gwy.port); - st.ext = s->ext; NTOHS(st.ext.port); + bcopy(&s->lan, &st.lan, sizeof(st.lan)); NTOHS(st.lan.port); + bcopy(&s->gwy, &st.gwy, sizeof(st.gwy)); NTOHS(st.gwy.port); + bcopy(&s->ext, &st.ext, sizeof(st.ext)); NTOHS(st.ext.port); pf_state_peer_ntoh(&s->src, &st.src); pf_state_peer_ntoh(&s->dst, &st.dst); st.rule.nr = ntohl(s->rule.nr); - st.rt_addr = s->rt_addr; + bcopy(&s->rt_addr, &st.rt_addr, sizeof(st.rt_addr)); st.creation = ntohl(s->creation); st.expire = ntohl(s->expire); st.packets = ntohl(s->packets); |