From: Denis Ovsienko Date: Wed, 30 Sep 2020 02:46:47 +0000 (+0100) Subject: IGMP: Remove all remaining ND_TCHECK*() cases. X-Git-Tag: tcpdump-4.99-bp~173 X-Git-Url: https://git.tcpdump.org/tcpdump/commitdiff_plain/0a8c146f78c1cc40f5284ae2dcc52415c5938d49?ds=sidebyside IGMP: Remove all remaining ND_TCHECK*() cases. In print_mtrace() the check was just before a GET that fetches the last field of the structure. The other three checks tested exactly the space from that GET_IPADDR_STRING() would fetch anyway. --- diff --git a/print-igmp.c b/print-igmp.c index 77118994..914e3d6b 100644 --- a/print-igmp.c +++ b/print-igmp.c @@ -114,7 +114,6 @@ print_mtrace(netdissect_options *ndo, { const struct tr_query *tr = (const struct tr_query *)(bp + 8); - ND_TCHECK_SIZE(tr); if (len < 8 + sizeof (struct tr_query)) { ND_PRINT(" [invalid len %u]", len); return; @@ -126,9 +125,6 @@ print_mtrace(netdissect_options *ndo, GET_IPADDR_STRING(tr->tr_raddr)); if (IN_CLASSD(GET_BE_U_4(tr->tr_raddr))) ND_PRINT(" with-ttl %u", GET_U_1(tr->tr_rttl)); - return; -trunc: - nd_print_trunc(ndo); } static void @@ -153,7 +149,6 @@ print_igmpv3_report(netdissect_options *ndo, ND_PRINT(" [invalid number of groups]"); return; } - ND_TCHECK_4(bp + (group + 4)); ND_PRINT(" [gaddr %s", GET_IPADDR_STRING(bp + group + 4)); ND_PRINT(" %s", tok2str(igmpv3report2str, " [v3-report-#%u]", GET_U_1(bp + group))); @@ -169,7 +164,6 @@ print_igmpv3_report(netdissect_options *ndo, /* Print the sources */ ND_PRINT(" {"); for (j=0; jndo_vflag > 1) { ND_PRINT(" {"); for (i=0; i