summaryrefslogtreecommitdiff
path: root/print-igmp.c
diff options
context:
space:
mode:
authorFrancois-Xavier Le Bail <devel.fx.lebail@orange.fr>2020-08-10 16:22:37 +0200
committerFrancois-Xavier Le Bail <devel.fx.lebail@orange.fr>2020-09-05 14:59:21 +0200
commit929e4be621ebdcede37865a5767a175f083f9138 (patch)
treebf6ecbc038696e66176b2d50e04e015767f23b3d /print-igmp.c
parent54b5db3dde658894be730b15480f9b6e27b717a0 (diff)
downloadtcpdump-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-igmp.c')
-rw-r--r--print-igmp.c7
1 files changed, 0 insertions, 7 deletions
diff --git a/print-igmp.c b/print-igmp.c
index 4bdcba5d..2c83fb8a 100644
--- a/print-igmp.c
+++ b/print-igmp.c
@@ -163,7 +163,6 @@ print_igmpv3_report(netdissect_options *ndo,
ND_PRINT(" [invalid len %u]", len);
return;
}
- ND_TCHECK_2(bp + 6);
ngroups = GET_BE_U_2(bp + 6);
ND_PRINT(", %u group record(s)", ngroups);
if (ndo->ndo_vflag > 0) {
@@ -220,7 +219,6 @@ print_igmpv3_query(netdissect_options *ndo,
ND_PRINT(" [invalid len %u]", len);
return;
}
- ND_TCHECK_1(bp + 1);
mrc = GET_U_1(bp + 1);
if (mrc < 128) {
mrt = mrc;
@@ -236,11 +234,9 @@ print_igmpv3_query(netdissect_options *ndo,
}
ND_PRINT("]");
}
- ND_TCHECK_4(bp + 4);
if (GET_BE_U_4(bp + 4) == 0)
return;
ND_PRINT(" [gaddr %s", GET_IPADDR_STRING(bp + 4));
- ND_TCHECK_2(bp + 10);
nsrcs = GET_BE_U_2(bp + 10);
if (nsrcs > 0) {
if (len < 12 + (nsrcs << 2))
@@ -273,21 +269,18 @@ igmp_print(netdissect_options *ndo,
return;
}
- ND_TCHECK_1(bp);
switch (GET_U_1(bp)) {
case 0x11:
ND_PRINT("igmp query");
if (len >= 12)
print_igmpv3_query(ndo, bp, len);
else {
- ND_TCHECK_1(bp + 1);
if (GET_U_1(bp + 1)) {
ND_PRINT(" v2");
if (GET_U_1(bp + 1) != 100)
ND_PRINT(" [max resp time %u]", GET_U_1(bp + 1));
} else
ND_PRINT(" v1");
- ND_TCHECK_4(bp + 4);
if (GET_BE_U_4(bp + 4))
ND_PRINT(" [gaddr %s]", GET_IPADDR_STRING(bp + 4));
if (len != 8)