summaryrefslogtreecommitdiff
path: root/usr.sbin/tcpdump
diff options
context:
space:
mode:
authorCan Erkin Acar <canacar@cvs.openbsd.org>2010-10-09 08:22:27 +0000
committerCan Erkin Acar <canacar@cvs.openbsd.org>2010-10-09 08:22:27 +0000
commit6a48b42d970d42e49e886286dc5c86640f7cea6d (patch)
treefe163f4bb8121047b4728cf9f78c520da6992236 /usr.sbin/tcpdump
parentd9c02da6479d20d1d15f207b2f08af1b2cf97752 (diff)
Do not use BPF_WORDALIGN when computing pflog header length as it aligns
to 8-byte boundary on 64-bit architectures. Instead explicitly round up to a 4-byte boundary. Reported and tested by sthen@
Diffstat (limited to 'usr.sbin/tcpdump')
-rw-r--r--usr.sbin/tcpdump/print-pflog.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/usr.sbin/tcpdump/print-pflog.c b/usr.sbin/tcpdump/print-pflog.c
index 4599c523421..3d37ffe903e 100644
--- a/usr.sbin/tcpdump/print-pflog.c
+++ b/usr.sbin/tcpdump/print-pflog.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: print-pflog.c,v 1.22 2010/09/21 10:46:12 henning Exp $ */
+/* $OpenBSD: print-pflog.c,v 1.23 2010/10/09 08:22:26 canacar Exp $ */
/*
* Copyright (c) 1990, 1991, 1993, 1994, 1995, 1996
@@ -85,7 +85,7 @@ pflog_if_print(u_char *user, const struct pcap_pkthdr *h,
printf("[pflog: invalid header length!]");
goto out;
}
- hdrlen = BPF_WORDALIGN(hdr->length);
+ hdrlen = (hdr->length + 3) & 0xfc;
if (caplen < hdrlen) {
printf("[|pflog]");