]> The Tcpdump Group git mirrors - tcpdump/blobdiff - print-ip6opts.c
Add EXTRACT_ calls.
[tcpdump] / print-ip6opts.c
index 41b292e722eebbd6c0ca91fb2cfdec9596ad20d8..00cad3912b413dc2dffb5d9e1583475bb682b4f9 100644 (file)
@@ -171,13 +171,13 @@ trunc:
 }
 
 int
-hbhopt_print(netdissect_options *ndo, register const u_char *bp)
+hbhopt_print(netdissect_options *ndo, const u_char *bp)
 {
     const struct ip6_hbh *dp = (const struct ip6_hbh *)bp;
     u_int hbhlen = 0;
 
     ND_TCHECK(dp->ip6h_len);
-    hbhlen = (dp->ip6h_len + 1) << 3;
+    hbhlen = (EXTRACT_U_1(dp->ip6h_len) + 1) << 3;
     ND_TCHECK_LEN(dp, hbhlen);
     ND_PRINT((ndo, "HBH "));
     if (ndo->ndo_vflag)
@@ -191,13 +191,13 @@ hbhopt_print(netdissect_options *ndo, register const u_char *bp)
 }
 
 int
-dstopt_print(netdissect_options *ndo, register const u_char *bp)
+dstopt_print(netdissect_options *ndo, const u_char *bp)
 {
     const struct ip6_dest *dp = (const struct ip6_dest *)bp;
     u_int dstoptlen = 0;
 
     ND_TCHECK(dp->ip6d_len);
-    dstoptlen = (dp->ip6d_len + 1) << 3;
+    dstoptlen = (EXTRACT_U_1(dp->ip6d_len) + 1) << 3;
     ND_TCHECK_LEN(dp, dstoptlen);
     ND_PRINT((ndo, "DSTOPT "));
     if (ndo->ndo_vflag) {