diff options
author | Michael Shalayeff <mickey@cvs.openbsd.org> | 2002-12-20 22:26:00 +0000 |
---|---|---|
committer | Michael Shalayeff <mickey@cvs.openbsd.org> | 2002-12-20 22:26:00 +0000 |
commit | b4de73f698c4d926668866dcbcd5104ddb138521 (patch) | |
tree | 0d11382bebfb9e2c2b22d6e37f2cd4efb99ac148 /usr.sbin/tcpdump | |
parent | 5a28a8a5d99135ccab3c3ac492f24f8f7b9d1d38 (diff) |
use bcopy instead of struct assignment
Diffstat (limited to 'usr.sbin/tcpdump')
-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 5414a2f7aee..8111c5a0b8b 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: /cvs/OpenBSD/src/usr.sbin/tcpdump/print-pfsync.c,v 1.3 2002/11/30 13:56:23 mickey Exp $"; + "@(#) $Header: /cvs/OpenBSD/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); |