]> The Tcpdump Group git mirrors - tcpdump/blobdiff - print-msdp.c
Correctly check for various values of the ICMP type field.
[tcpdump] / print-msdp.c
index 4fe9eb87c4a4229999cf8351cc4510bed4b6d4b0..a228ab7cec53711bf8465db08fc68c6a2e171c4d 100644 (file)
  * FOR A PARTICULAR PURPOSE.
  */
 #ifndef lint
-static const char rcsid[] =
-    "@(#) $Header: /tcpdump/master/tcpdump/print-msdp.c,v 1.2 2001-12-10 08:06:40 guy Exp $";
+static const char rcsid[] _U_ =
+    "@(#) $Header: /tcpdump/master/tcpdump/print-msdp.c,v 1.7 2005-04-06 21:32:41 mcr Exp $";
 #endif
 
 #ifdef HAVE_CONFIG_H
 #include "config.h"
 #endif
 
+#include <tcpdump-stdinc.h>
+
 #include <stdio.h>
 #include <stdlib.h>
-#include <unistd.h>
-
-#include <netinet/in.h>
 
 #include "interface.h"
 #include "addrtoname.h"
@@ -53,7 +52,7 @@ msdp_print(const unsigned char *sp, u_int length)
                type = *sp;
                len = EXTRACT_16BITS(sp + 1);
                if (len > 1400 || vflag)
-                       printf(" [len %d]", len);
+                       printf(" [len %u]", len);
                if (len < 3)
                        goto trunc;
                sp += 3;
@@ -66,12 +65,12 @@ msdp_print(const unsigned char *sp, u_int length)
                        else
                                (void)printf(" SA-Response");
                        TCHECK(*sp);
-                       (void)printf(" %d entries", *sp);
-                       if (*sp * 12 + 8 < len) {
+                       (void)printf(" %u entries", *sp);
+                       if ((u_int)((*sp * 12) + 8) < len) {
                                (void)printf(" [w/data]");
                                if (vflag > 1) {
                                        (void)printf(" ");
-                                       ip_print(sp + *sp * 12 + 8 - 3,
+                                       ip_print(gndo, sp + *sp * 12 + 8 - 3,
                                                 len - (*sp * 12 + 8));
                                }
                        }
@@ -100,3 +99,10 @@ msdp_print(const unsigned char *sp, u_int length)
 trunc:
        (void)printf(" [|msdp]");
 }
+
+/*
+ * Local Variables:
+ * c-style: whitesmith
+ * c-basic-offset: 8
+ * End:
+ */