]> The Tcpdump Group git mirrors - tcpdump/blobdiff - print-ip6opts.c
Avoid -E and -M options inconsistencies with no libcrypto
[tcpdump] / print-ip6opts.c
index 3f91b64a675af092f2e27beaea25dfe048363e3c..ca0006027dd28cca51c8e87cd80172f0c78db394 100644 (file)
@@ -29,9 +29,7 @@
 
 /* \summary: IPv6 header option printer */
 
-#ifdef HAVE_CONFIG_H
 #include <config.h>
-#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