summaryrefslogtreecommitdiffstats
path: root/usr.sbin/tcpdump/print-ip.c
diff options
context:
space:
mode:
authormikeb <mikeb@openbsd.org>2014-12-09 17:03:19 +0000
committermikeb <mikeb@openbsd.org>2014-12-09 17:03:19 +0000
commit1d0e91d0c3b766038d6632d49b5a81ac0f8cb5b9 (patch)
tree065e70eaf96045cea56c9aa0e481e447459ac1ad /usr.sbin/tcpdump/print-ip.c
parentinit crmsg to something so it doesn't crash on invalid wtmp files. (diff)
downloadwireguard-openbsd-1d0e91d0c3b766038d6632d49b5a81ac0f8cb5b9.tar.xz
wireguard-openbsd-1d0e91d0c3b766038d6632d49b5a81ac0f8cb5b9.zip
Catch up with the BPF_ALIGNMENT switch to the uint32_t.
bpf aligns data following the datalink header (e.g. ethernet) on the BPF_ALIGNMENT boundary. Since rev1.41 of bpf.h it's uint32_t instead of a long. And also since then almost all packets become "unaligned" from the tcpdump perspective and require costly copies into the internal buffer. Neither IP header (struct ip) nor IPv6 (struct ip6_hdr) have fields larger than 32 bits and therefore alignment requirements for them are at most 32 bit. ok millert, jsg, deraadt
Diffstat (limited to 'usr.sbin/tcpdump/print-ip.c')
-rw-r--r--usr.sbin/tcpdump/print-ip.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/usr.sbin/tcpdump/print-ip.c b/usr.sbin/tcpdump/print-ip.c
index 11c183ace1e..604f45aa652 100644
--- a/usr.sbin/tcpdump/print-ip.c
+++ b/usr.sbin/tcpdump/print-ip.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: print-ip.c,v 1.41 2014/12/03 13:22:18 mikeb Exp $ */
+/* $OpenBSD: print-ip.c,v 1.42 2014/12/09 17:03:19 mikeb Exp $ */
/*
* Copyright (c) 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997
@@ -370,7 +370,7 @@ ip_print(register const u_char *bp, register u_int length)
* This will never happen with BPF. It does happen with raw packet
* dumps from -r.
*/
- if ((intptr_t)ip & (sizeof(long)-1)) {
+ if ((intptr_t)ip & (sizeof(u_int32_t)-1)) {
static u_char *abuf = NULL;
static int didwarn = 0;
int clen = snapend - bp;