]> The Tcpdump Group git mirrors - tcpdump/blobdiff - print-juniper.c
Makefile.in: Remove files win32/prj/* from EXTRA_DIST
[tcpdump] / print-juniper.c
index 009897da49ed7b3c471b862ba5f9487d79354862..0394fd89f1ef5f6633b64a92fb0b25d513194a62 100644 (file)
@@ -425,11 +425,11 @@ struct juniper_l2info_t {
     uint32_t caplen;
     uint32_t pictype;
     uint8_t direction;
-    uint8_t header_len;
+    u_int header_len;
     uint8_t cookie_len;
     uint8_t cookie_type;
     uint8_t cookie[8];
-    uint8_t bundle;
+    u_int bundle;
     uint16_t proto;
     uint8_t flags;
 };
@@ -576,8 +576,8 @@ juniper_es_if_print(netdissect_options *ndo,
                        tok2str(juniper_ipsec_type_values,"Unknown",GET_U_1(ih->type)),
                        GET_U_1(ih->type),
                        GET_BE_U_4(ih->spi),
-                       ipaddr_string(ndo, ih->src_ip),
-                       ipaddr_string(ndo, ih->dst_ip),
+                       GET_IPADDR_STRING(ih->src_ip),
+                       GET_IPADDR_STRING(ih->dst_ip),
                        l2info.length);
             } else {
                 ND_PRINT("ES SA, index %u, ttl %u type %s (%u), length %u\n",
@@ -694,7 +694,7 @@ juniper_pppoe_if_print(netdissect_options *ndo,
 
         p+=l2info.header_len;
         /* this DLT contains nothing but raw ethernet frames */
-        ether_print(ndo, p, l2info.length, l2info.caplen, NULL, NULL);
+        ether_print(ndo, p, l2info.length, l2info.caplen, NULL, NULL, FALSE);
         return l2info.header_len;
 }
 #endif
@@ -713,7 +713,7 @@ juniper_ether_if_print(netdissect_options *ndo,
 
         p+=l2info.header_len;
         /* this DLT contains nothing but raw Ethernet frames */
-        ether_print(ndo, p, l2info.length, l2info.caplen, NULL, NULL);
+        ether_print(ndo, p, l2info.length, l2info.caplen, NULL, NULL, FALSE);
         return l2info.header_len;
 }
 #endif
@@ -1071,7 +1071,7 @@ juniper_atm2_if_print(netdissect_options *ndo,
         if (l2info.direction != JUNIPER_BPF_PKT_IN && /* ether-over-1483 encaps ? */
             /* use EXTRACT_, not GET_ (not packet buffer pointer) */
             (EXTRACT_BE_U_4(l2info.cookie) & ATM2_GAP_COUNT_MASK)) {
-            ether_print(ndo, p, l2info.length, l2info.caplen, NULL, NULL);
+            ether_print(ndo, p, l2info.length, l2info.caplen, NULL, NULL, FALSE);
             return l2info.header_len;
         }
 
@@ -1399,6 +1399,11 @@ juniper_parse_header(netdissect_options *ndo,
                        lp->s,
                        l2info->cookie_len);
 
+            if (l2info->cookie_len > 8) {
+                nd_print_invalid(ndo);
+                return 0;
+            }
+
             if (l2info->cookie_len > 0) {
                 ND_TCHECK_LEN(p, l2info->cookie_len);
                 if (ndo->ndo_eflag)