diff options
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 */ |