diff options
author | 2001-10-30 12:30:04 +0000 | |
---|---|---|
committer | 2001-10-30 12:30:04 +0000 | |
commit | 398521af7c47d4d8a7708143006be4bb4170184b (patch) | |
tree | 84e8b4334dbb308caf044faad93961d77dd61474 | |
parent | do not allow setting autorepeat delays causing zero timeouts later. (diff) | |
download | wireguard-openbsd-398521af7c47d4d8a7708143006be4bb4170184b.tar.xz wireguard-openbsd-398521af7c47d4d8a7708143006be4bb4170184b.zip |
ddp_print needs aligned data (alpha,sparc). Noted (with a patch) by <jepeway@blasted-heath.com>. Patch code relocated inside ddp_print(). Fixes PR# 1945.
-rw-r--r-- | usr.sbin/tcpdump/print-atalk.c | 20 |
1 files changed, 18 insertions, 2 deletions
diff --git a/usr.sbin/tcpdump/print-atalk.c b/usr.sbin/tcpdump/print-atalk.c index 35e2a5e2df9..480f0e7409b 100644 --- a/usr.sbin/tcpdump/print-atalk.c +++ b/usr.sbin/tcpdump/print-atalk.c @@ -1,4 +1,4 @@ -/* $OpenBSD: print-atalk.c,v 1.16 2000/10/31 16:06:48 deraadt Exp $ */ +/* $OpenBSD: print-atalk.c,v 1.17 2001/10/30 12:30:04 ho Exp $ */ /* * Copyright (c) 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997 @@ -25,7 +25,7 @@ #ifndef lint static const char rcsid[] = - "@(#) $Header: /home/cvs/src/usr.sbin/tcpdump/print-atalk.c,v 1.16 2000/10/31 16:06:48 deraadt Exp $ (LBL)"; + "@(#) $Header: /home/cvs/src/usr.sbin/tcpdump/print-atalk.c,v 1.17 2001/10/30 12:30:04 ho Exp $ (LBL)"; #endif #include <sys/param.h> @@ -224,6 +224,22 @@ ddp_print(register const u_char *bp, register u_int length, register int t, register u_short snet, register u_char snode, u_char skt) { +#ifdef LBL_ALIGN + if ((long)bp & 3) { + static u_char *abuf = NULL; + + if (abuf == NULL) { + abuf = (u_char *)malloc(snaplen); + if (abuf == NULL) + error("ddp_print: malloc"); + } + memcpy(abuf, bp, min(length, snaplen)); + snapend += abuf - bp; + packetp = abuf; + bp = abuf; + } +#endif + switch (t) { case ddpNBP: |