X-Git-Url: https://git.tcpdump.org/tcpdump/blobdiff_plain/b638c78b40951d394e14dea3608f87a1cff9786f..c7b0738460b08e63a1bd15c88ef1f9599cd71a08:/print-igmp.c diff --git a/print-igmp.c b/print-igmp.c index 6cdcde27..0bb7f976 100644 --- a/print-igmp.c +++ b/print-igmp.c @@ -19,11 +19,13 @@ * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. */ +/* \summary: Internet Group Management Protocol (IGMP) printer */ + #ifdef HAVE_CONFIG_H #include "config.h" #endif -#include +#include #include "netdissect.h" #include "addrtoname.h" @@ -203,7 +205,7 @@ print_igmpv3_query(netdissect_options *ndo, register const u_char *bp, register u_int len) { u_int mrc; - int mrt; + u_int mrt; u_int nsrcs; register u_int i; @@ -225,7 +227,7 @@ print_igmpv3_query(netdissect_options *ndo, if (mrt < 600) { ND_PRINT((ndo, "%.1fs", mrt * 0.1)); } else { - relts_print(ndo, mrt / 10); + unsigned_relts_print(ndo, mrt / 10); } ND_PRINT((ndo, "]")); } @@ -326,7 +328,7 @@ igmp_print(netdissect_options *ndo, break; } - if (ndo->ndo_vflag && ND_TTEST2(bp[0], len)) { + if (ndo->ndo_vflag && len >= 4 && ND_TTEST2(bp[0], len)) { /* Check the IGMP checksum */ vec[0].ptr = bp; vec[0].len = len;