]> The Tcpdump Group git mirrors - tcpdump/commitdiff
SLIP: Remove 4 ND_TCHECK_SIZE() calls
authorFrancois-Xavier Le Bail <[email protected]>
Thu, 1 Oct 2020 20:07:58 +0000 (22:07 +0200)
committerFrancois-Xavier Le Bail <[email protected]>
Sun, 10 Jan 2021 07:09:46 +0000 (08:09 +0100)
IP_HL() and TH_OFF() macros use GET_U_1().

print-sl.c

index 85b762496d245cb043bc289ae09f685d5f33b0ef..88f9fb0291e10fe48b32cac3cfecd89097477cba 100644 (file)
@@ -149,9 +149,7 @@ sliplink_print(netdissect_options *ndo,
                        /* Direction is bogus, don't use it */
                        return;
                }
-               ND_TCHECK_SIZE(ip);
                hlen = IP_HL(ip);
-               ND_TCHECK_SIZE((const struct tcphdr *)&((const int *)ip)[hlen]);
                hlen += TH_OFF((const struct tcphdr *)&((const int *)ip)[hlen]);
                lastlen[dir][lastconn] = length - (hlen << 2);
                break;
@@ -250,9 +248,7 @@ compressed_sl_print(netdissect_options *ndo,
         * 'cp - chdr' is the length of the compressed header.
         * 'length - hlen' is the amount of data in the packet.
         */
-       ND_TCHECK_SIZE(ip);
        hlen = IP_HL(ip);
-       ND_TCHECK_SIZE((const struct tcphdr *)&((const int32_t *)ip)[hlen]);
        hlen += TH_OFF((const struct tcphdr *)&((const int32_t *)ip)[hlen]);
        lastlen[dir][lastconn] = length - (hlen << 2);
        ND_PRINT(" %u (%ld)", lastlen[dir][lastconn], (long)(cp - chdr));