X-Git-Url: https://git.tcpdump.org/tcpdump/blobdiff_plain/b41f0d1ca30515b474af73bea9ae6975fd111256..4fe64c9d253007f06b52c6d8be2c99bfc28f989b:/print-ip6.c diff --git a/print-ip6.c b/print-ip6.c index d1a84985..a3bc90d5 100644 --- a/print-ip6.c +++ b/print-ip6.c @@ -21,7 +21,7 @@ #ifndef lint static const char rcsid[] _U_ = - "@(#) $Header: /tcpdump/master/tcpdump/print-ip6.c,v 1.43 2004-05-01 10:15:33 hannes Exp $"; + "@(#) $Header: /tcpdump/master/tcpdump/print-ip6.c,v 1.49 2005-07-03 20:33:06 hannes Exp $"; #endif #ifdef HAVE_CONFIG_H @@ -63,7 +63,7 @@ ip6_print(register const u_char *bp, register u_int length) TCHECK(*ip6); if (length < sizeof (struct ip6_hdr)) { - (void)printf("truncated-ip6 %d", length); + (void)printf("truncated-ip6 %u", length); return; } @@ -73,7 +73,7 @@ ip6_print(register const u_char *bp, register u_int length) payload_len = EXTRACT_16BITS(&ip6->ip6_plen); len = payload_len + sizeof(struct ip6_hdr); if (length < len) - (void)printf("truncated-ip6 - %d bytes missing!", + (void)printf("truncated-ip6 - %u bytes missing!", len - length); if (vflag) { @@ -93,7 +93,7 @@ ip6_print(register const u_char *bp, register u_int length) (void)printf("flowlabel 0x%05x, ", flow & 0x000fffff); #endif - (void)printf("hlim %u, next-header: %s (%u), payload-len %u) ", + (void)printf("hlim %u, next-header: %s (%u), length: %u) ", ip6->ip6_hlim, tok2str(ipproto_values,"unknown",ip6->ip6_nxt), ip6->ip6_nxt, @@ -176,7 +176,7 @@ ip6_print(register const u_char *bp, register u_int length) case IPPROTO_ESP: { int enh, padlen; - advance = esp_print(gndo, cp, (const u_char *)ip6, &enh, &padlen); + advance = esp_print(gndo, cp, len, (const u_char *)ip6, &enh, &padlen); nh = enh & 0xff; len -= padlen; break; @@ -192,6 +192,7 @@ ip6_print(register const u_char *bp, register u_int length) case IPPROTO_PIM: pim_print(cp, len); return; + case IPPROTO_OSPF: ospf6_print(cp, len); return; @@ -201,7 +202,19 @@ ip6_print(register const u_char *bp, register u_int length) return; case IPPROTO_IPV4: - ip_print(cp, len); + ip_print(gndo, cp, len); + return; + + case IPPROTO_PGM: + pgm_print(cp, len, (const u_char *)ip6); + return; + + case IPPROTO_GRE: + gre_print(cp, len); + return; + + case IPPROTO_RSVP: + rsvp_print(cp, len); return; case IPPROTO_NONE: