]> The Tcpdump Group git mirrors - tcpdump/blobdiff - print-igmp.c
Try marking structures as UNALIGNED.
[tcpdump] / print-igmp.c
index 6cdcde272acb0944e3396dab21134dce4bf4a4c5..0bb7f9762e9195970522e6d702dd6391d76788f6 100644 (file)
  * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
  */
 
+/* \summary: Internet Group Management Protocol (IGMP) printer */
+
 #ifdef HAVE_CONFIG_H
 #include "config.h"
 #endif
 
-#include <tcpdump-stdinc.h>
+#include <netdissect-stdinc.h>
 
 #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;