]> The Tcpdump Group git mirrors - tcpdump/commitdiff
icmp6: make opt_len a full-width u_int.
authorGuy Harris <[email protected]>
Wed, 27 May 2020 05:05:17 +0000 (22:05 -0700)
committerGuy Harris <[email protected]>
Wed, 27 May 2020 05:05:17 +0000 (22:05 -0700)
That way, when it's multiplied by 8 (shifted left 3 positions), the
result will be a u_int, as it should be, not a signed int.

print-icmp6.c

index 4fa35b2e01379d7da51e1f8e1b257cd6c2ef2576..8bb7242d76e529627e5a9a5ee94c1c8f410acc9b 100644 (file)
@@ -1429,7 +1429,8 @@ static int
 icmp6_opt_print(netdissect_options *ndo, const u_char *bp, int resid)
 {
        const struct nd_opt_hdr *op;
-       uint8_t opt_type, opt_len;
+       uint8_t opt_type;
+       u_int opt_len;
        const struct nd_opt_prefix_info *opp;
        const struct nd_opt_mtu *opm;
        const struct nd_opt_rdnss *oprd;