X-Git-Url: https://git.tcpdump.org/tcpdump/blobdiff_plain/b6dde136cd500b6c93b291c92b8c929387f71da5..refs/heads/coverity_scan:/print-ip6opts.c diff --git a/print-ip6opts.c b/print-ip6opts.c index 3f91b64a..ca000602 100644 --- a/print-ip6opts.c +++ b/print-ip6opts.c @@ -29,9 +29,7 @@ /* \summary: IPv6 header option printer */ -#ifdef HAVE_CONFIG_H #include -#endif #include "netdissect-stdinc.h" @@ -222,11 +220,11 @@ hbhopt_process(netdissect_options *ndo, const u_char *bp, int *found_jumbo, const struct ip6_hbh *dp = (const struct ip6_hbh *)bp; u_int hbhlen = 0; - ndo->ndo_protocol = "hbhopt"; - ND_TCHECK_1(dp->ip6h_len); + ndo->ndo_protocol = "hbh"; hbhlen = (GET_U_1(dp->ip6h_len) + 1) << 3; ND_TCHECK_LEN(dp, hbhlen); - ND_PRINT("HBH "); + nd_print_protocol_caps(ndo); + ND_PRINT(" "); if (ip6_opt_process(ndo, (const u_char *)dp + sizeof(*dp), hbhlen - sizeof(*dp), found_jumbo, jumbolen) == -1) goto trunc; @@ -244,10 +242,10 @@ dstopt_process(netdissect_options *ndo, const u_char *bp) u_int dstoptlen = 0; ndo->ndo_protocol = "dstopt"; - ND_TCHECK_1(dp->ip6d_len); dstoptlen = (GET_U_1(dp->ip6d_len) + 1) << 3; ND_TCHECK_LEN(dp, dstoptlen); - ND_PRINT("DSTOPT "); + nd_print_protocol_caps(ndo); + ND_PRINT(" "); if (ndo->ndo_vflag) { /* * The Jumbo Payload option is a hop-by-hop option; we don't