X-Git-Url: https://git.tcpdump.org/tcpdump/blobdiff_plain/aad6ac30ce7904f688226dbc61021ca4f907274f..a10ab62bf4f611c63b479df48ab8c9192fa0b281:/print-igmp.c diff --git a/print-igmp.c b/print-igmp.c index 8c5bc15d..914e3d6b 100644 --- a/print-igmp.c +++ b/print-igmp.c @@ -109,46 +109,22 @@ static const struct tok igmpv3report2str[] = { static void print_mtrace(netdissect_options *ndo, + const char *typename, const u_char *bp, u_int len) { 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; } - ND_PRINT("mtrace %u: %s to %s reply-to %s", + ND_PRINT("%s %u: %s to %s reply-to %s", + typename, GET_BE_U_3(tr->tr_qid), GET_IPADDR_STRING(tr->tr_src), GET_IPADDR_STRING(tr->tr_dst), 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 -print_mresp(netdissect_options *ndo, - const u_char *bp, u_int len) -{ - 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; - } - ND_PRINT("mresp %u: %s to %s reply-to %s", - GET_BE_U_3(tr->tr_qid), - GET_IPADDR_STRING(tr->tr_src), GET_IPADDR_STRING(tr->tr_dst), - 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 @@ -173,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))); @@ -189,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