]> The Tcpdump Group git mirrors - tcpdump/blobdiff - print-isakmp.c
s/sprintf/snprintf/.
[tcpdump] / print-isakmp.c
index 7acf89402075002078d319aadf8e6ad675d667b1..5f4abc00aa1e5dda5b2c0b4abdccf26cf73de1ec 100644 (file)
 
 #ifndef lint
 static const char rcsid[] =
-    "@(#) $Header: /tcpdump/master/tcpdump/print-isakmp.c,v 1.6 1999-10-30 07:36:37 itojun Exp $ (LBL)";
+    "@(#) $Header: /tcpdump/master/tcpdump/print-isakmp.c,v 1.10 2000-01-17 06:24:25 itojun Exp $ (LBL)";
+#endif
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
 #endif
 
 #include <string.h>
@@ -997,6 +1001,7 @@ isakmp_print(const u_char *bp, u_int length, const u_char *bp2)
        u_char np;
        int i;
        int phase;
+       int major, minor;
 
        base = (struct isakmp *)bp;
        ep = (u_char *)snapend;
@@ -1007,8 +1012,13 @@ isakmp_print(const u_char *bp, u_int length, const u_char *bp2)
        }
 
        printf("isakmp");
-       if (vflag)
-               printf(" %d.%d", base->v_maj, base->v_min);
+       if (vflag) {
+               major = (base->vers & ISAKMP_VERS_MAJOR)
+                               >> ISAKMP_VERS_MAJOR_SHIFT;
+               minor = (base->vers & ISAKMP_VERS_MINOR)
+                               >> ISAKMP_VERS_MINOR_SHIFT;
+               printf(" %d.%d", major, minor);
+       }
 
        if (vflag) {
                printf(" msgid ");