diff options
author | Francois-Xavier Le Bail <devel.fx.lebail@orange.fr> | 2020-08-10 16:22:37 +0200 |
---|---|---|
committer | Francois-Xavier Le Bail <devel.fx.lebail@orange.fr> | 2020-09-05 14:59:21 +0200 |
commit | 929e4be621ebdcede37865a5767a175f083f9138 (patch) | |
tree | bf6ecbc038696e66176b2d50e04e015767f23b3d /print-mobility.c | |
parent | 54b5db3dde658894be730b15480f9b6e27b717a0 (diff) | |
download | tcpdump-test-rc.tar.gz |
Remove many (761) redundant ND_TCHECK_n() callstest-rc
ND_TCHECK_n(e), n in { 1, 2, 3, 4, 8 }.
They are redundant because they are followed by a GET_.*_n(e) call,
same n, same e, which do the bounds check.
Remove unused 'trunc' labels and most associated codes.
Update the outputs of some tests accordingly.
Diffstat (limited to 'print-mobility.c')
-rw-r--r-- | print-mobility.c | 17 |
1 files changed, 0 insertions, 17 deletions
diff --git a/print-mobility.c b/print-mobility.c index cdb43167..a79c7c2d 100644 --- a/print-mobility.c +++ b/print-mobility.c @@ -117,12 +117,10 @@ mobility_opt_print(netdissect_options *ndo, unsigned i, optlen; for (i = 0; i < len; i += optlen) { - ND_TCHECK_1(bp + i); if (GET_U_1(bp + i) == IP6MOPT_PAD1) optlen = 1; else { if (i + 1 < len) { - ND_TCHECK_1(bp + i + 1); optlen = GET_U_1(bp + i + 1) + 2; } else @@ -149,7 +147,6 @@ mobility_opt_print(netdissect_options *ndo, goto trunc; } /* units of 4 secs */ - ND_TCHECK_2(bp + i + 2); ND_PRINT("(refresh: %u)", GET_BE_U_2(bp + i + 2) << 2); break; @@ -166,8 +163,6 @@ mobility_opt_print(netdissect_options *ndo, ND_PRINT("(ni: trunc)"); goto trunc; } - ND_TCHECK_2(bp + i + 2); - ND_TCHECK_2(bp + i + 4); ND_PRINT("(ni: ho=0x%04x co=0x%04x)", GET_BE_U_2(bp + i + 2), GET_BE_U_2(bp + i + 4)); @@ -234,7 +229,6 @@ mobility_print(netdissect_options *ndo, /* XXX ip6m_cksum */ - ND_TCHECK_1(mh->ip6m_type); type = GET_U_1(mh->ip6m_type); if (type <= IP6M_MAX && mhlen < ip6m_hdrlen[type]) { ND_PRINT("(header length %u is too small for type %u)", mhlen, type); @@ -249,7 +243,6 @@ mobility_print(netdissect_options *ndo, case IP6M_CAREOF_TEST_INIT: hlen = IP6M_MINLEN; if (ndo->ndo_vflag) { - ND_TCHECK_4(bp + hlen + 4); ND_PRINT(" %s Init Cookie=%08x:%08x", type == IP6M_HOME_TEST_INIT ? "Home" : "Care-of", GET_BE_U_4(bp + hlen), @@ -259,11 +252,9 @@ mobility_print(netdissect_options *ndo, break; case IP6M_HOME_TEST: case IP6M_CAREOF_TEST: - ND_TCHECK_2(mh->ip6m_data16[0]); ND_PRINT(" nonce id=0x%x", GET_BE_U_2(mh->ip6m_data16[0])); hlen = IP6M_MINLEN; if (ndo->ndo_vflag) { - ND_TCHECK_4(bp + hlen + 4); ND_PRINT(" %s Init Cookie=%08x:%08x", type == IP6M_HOME_TEST ? "Home" : "Care-of", GET_BE_U_4(bp + hlen), @@ -271,7 +262,6 @@ mobility_print(netdissect_options *ndo, } hlen += 8; if (ndo->ndo_vflag) { - ND_TCHECK_4(bp + hlen + 4); ND_PRINT(" %s Keygen Token=%08x:%08x", type == IP6M_HOME_TEST ? "Home" : "Care-of", GET_BE_U_4(bp + hlen), @@ -280,7 +270,6 @@ mobility_print(netdissect_options *ndo, hlen += 8; break; case IP6M_BINDING_UPDATE: - ND_TCHECK_2(mh->ip6m_data16[0]); ND_PRINT(" seq#=%u", GET_BE_U_2(mh->ip6m_data16[0])); hlen = IP6M_MINLEN; ND_TCHECK_2(bp + hlen); @@ -299,29 +288,23 @@ mobility_print(netdissect_options *ndo, hlen += 1; /* Reserved (8bits) */ hlen += 1; - ND_TCHECK_2(bp + hlen); /* units of 4 secs */ ND_PRINT(" lifetime=%u", GET_BE_U_2(bp + hlen) << 2); hlen += 2; break; case IP6M_BINDING_ACK: - ND_TCHECK_1(mh->ip6m_data8[0]); ND_PRINT(" status=%u", GET_U_1(mh->ip6m_data8[0])); - ND_TCHECK_1(mh->ip6m_data8[1]); if (GET_U_1(mh->ip6m_data8[1]) & 0x80) ND_PRINT(" K"); /* Reserved (7bits) */ hlen = IP6M_MINLEN; - ND_TCHECK_2(bp + hlen); ND_PRINT(" seq#=%u", GET_BE_U_2(bp + hlen)); hlen += 2; - ND_TCHECK_2(bp + hlen); /* units of 4 secs */ ND_PRINT(" lifetime=%u", GET_BE_U_2(bp + hlen) << 2); hlen += 2; break; case IP6M_BINDING_ERROR: - ND_TCHECK_1(mh->ip6m_data8[0]); ND_PRINT(" status=%u", GET_U_1(mh->ip6m_data8[0])); /* Reserved */ hlen = IP6M_MINLEN; |