diff options
author | fenner <fenner@FreeBSD.org> | 2003-03-02 08:22:26 +0000 |
---|---|---|
committer | fenner <fenner@FreeBSD.org> | 2003-03-02 08:22:26 +0000 |
commit | 5f76ebca43302f98858e83a6212d9c610e939bad (patch) | |
tree | c244ceda18deb5fc8e576971e1e83b7b631f5219 /contrib/tcpdump/print-atalk.c | |
parent | 24ede2d805a7ffac09999aafe7d4f285e45a6edd (diff) | |
download | FreeBSD-src-5f76ebca43302f98858e83a6212d9c610e939bad.zip FreeBSD-src-5f76ebca43302f98858e83a6212d9c610e939bad.tar.gz |
Import tcpdump 3.7.2 (fudging for multi-DLT support) from
http://www.tcpdump.org/release/tcpdump-3.7.2.tar.gz
Diffstat (limited to 'contrib/tcpdump/print-atalk.c')
-rw-r--r-- | contrib/tcpdump/print-atalk.c | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/contrib/tcpdump/print-atalk.c b/contrib/tcpdump/print-atalk.c index 5446521..d0760c5 100644 --- a/contrib/tcpdump/print-atalk.c +++ b/contrib/tcpdump/print-atalk.c @@ -23,7 +23,7 @@ #ifndef lint static const char rcsid[] = - "@(#) $Header: /tcpdump/master/tcpdump/print-atalk.c,v 1.70 2001/11/15 08:23:12 itojun Exp $ (LBL)"; + "@(#) $Header: /tcpdump/master/tcpdump/print-atalk.c,v 1.70.2.1 2002/02/05 10:04:18 guy Exp $ (LBL)"; #endif #ifdef HAVE_CONFIG_H @@ -112,6 +112,14 @@ llap_print(register const u_char *bp, u_int length) register const struct atShortDDP *sdp; u_short snet; + /* + * Our packet is on a 4-byte boundary, as we're either called + * directly from a top-level link-layer printer (ltalk_if_print) + * or from the UDP printer. The LLAP+DDP header is a multiple + * of 4 bytes in length, so the DDP payload is also on a 4-byte + * boundary, and we don't need to align it before calling + * "ddp_print()". + */ lp = (const struct LAP *)bp; bp += sizeof(*lp); length -= sizeof(*lp); @@ -394,6 +402,11 @@ nbp_print(register const struct atNBP *np, u_int length, register u_short snet, int i; const u_char *ep; + if (length < nbpHeaderSize) { + (void)printf(" truncated-nbp %d", length); + return; + } + length -= nbpHeaderSize; if (length < 8) { /* must be room for at least one tuple */ |