X-Git-Url: https://git.tcpdump.org/tcpdump/blobdiff_plain/c672f002763b3a4fc30ca229e57f50d3b2e6d766..ad6df73f5a6c46a409c7629f5588b1b81dff6357:/print-ip6.c?ds=sidebyside diff --git a/print-ip6.c b/print-ip6.c index 68d7d6e2..d1593995 100644 --- a/print-ip6.c +++ b/print-ip6.c @@ -21,7 +21,7 @@ #ifndef lint static const char rcsid[] = - "@(#) $Header: /tcpdump/master/tcpdump/print-ip6.c,v 1.18 2001-09-17 21:58:03 fenner Exp $"; + "@(#) $Header: /tcpdump/master/tcpdump/print-ip6.c,v 1.21 2001-11-16 02:17:36 itojun Exp $"; #endif #ifdef HAVE_CONFIG_H @@ -66,18 +66,20 @@ ip6_print(register const u_char *bp, register u_int length) #ifdef LBL_ALIGN /* * The IP6 header is not 16-byte aligned, so copy into abuf. - * This will never happen with BPF. It does happen raw packet - * dumps from -r. */ if ((u_long)ip6 & 15) { static u_char *abuf; - if (abuf == NULL) + if (abuf == NULL) { abuf = malloc(snaplen); + if (abuf == NULL) + error("ip6_print: malloc"); + } memcpy(abuf, ip6, min(length, snaplen)); snapend += abuf - (u_char *)ip6; packetp = abuf; ip6 = (struct ip6_hdr *)abuf; + bp = abuf; } #endif TCHECK(*ip6);