]> The Tcpdump Group git mirrors - tcpdump/blobdiff - print-juniper.c
switch from shell script to complex test
[tcpdump] / print-juniper.c
index 7ee82dc22dd5b0443ee0e7856aff7b0bdcb2eefc..91d5755b31239029309343530a0fd83fe4c497c7 100644 (file)
@@ -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",
@@ -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)