]> The Tcpdump Group git mirrors - tcpdump/commitdiff
IP: Simplify an expression
authorFrancois-Xavier Le Bail <[email protected]>
Sat, 22 Sep 2018 10:46:36 +0000 (12:46 +0200)
committerFrancois-Xavier Le Bail <[email protected]>
Sat, 22 Sep 2018 10:46:36 +0000 (12:46 +0200)
print-ip.c

index 07c9c0fe95d9aeb680a99f35aa55b6bf98ba2e3e..8b263ccc81fe0c074cc88a7a8cebd1442b67b871 100644 (file)
@@ -99,7 +99,7 @@ ip_finddst(netdissect_options *ndo,
        const u_char *cp;
 
        cp = (const u_char *)(ip + 1);
-       length = (IP_HL(ip) << 2);
+       length = IP_HL(ip) * 4;
        if (length < sizeof(struct ip))
                goto trunc;
        length -= sizeof(struct ip);