diff options
Diffstat (limited to 'contrib/tcpdump/print-igmp.c')
-rw-r--r-- | contrib/tcpdump/print-igmp.c | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/contrib/tcpdump/print-igmp.c b/contrib/tcpdump/print-igmp.c index e4808a7..0bb7f97 100644 --- a/contrib/tcpdump/print-igmp.c +++ b/contrib/tcpdump/print-igmp.c @@ -19,16 +19,17 @@ * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. */ -#define NETDISSECT_REWORKED +/* \summary: Internet Group Management Protocol (IGMP) printer */ + #ifdef HAVE_CONFIG_H #include "config.h" #endif -#include <tcpdump-stdinc.h> +#include <netdissect-stdinc.h> -#include "interface.h" +#include "netdissect.h" #include "addrtoname.h" -#include "extract.h" /* must come after interface.h */ +#include "extract.h" #ifndef IN_CLASSD #define IN_CLASSD(i) (((int32_t)(i) & 0xf0000000) == 0xe0000000) @@ -204,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; @@ -226,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, "]")); } @@ -327,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; |