]> The Tcpdump Group git mirrors - tcpdump/commitdiff
Constify.
authorguy <guy>
Thu, 5 Sep 2002 00:43:21 +0000 (00:43 +0000)
committerguy <guy>
Thu, 5 Sep 2002 00:43:21 +0000 (00:43 +0000)
Check for zero-length items in "isakmp_sub0_print()", and return NULL if
one is seen.  Have "isakmp_sub_print()" check for that and break out of
the loop and return NULL if "isakmp_sub0_print()" returns NULL, so we
don't loop forever printing the same item.  Have callers of
"isakmp_sub_print()" check for NULL and return NULL as well.

Have "isakmp_sub_print()" take the depth as an argument, rather than
have it as a static variable, for cleanliness.

print-isakmp.c

index 2df29c23ed0c68b509bdf0ec9ec420f8575c3dcb..106d3479d9a8dfa4d3b920c376f010de817643cd 100644 (file)
@@ -30,7 +30,7 @@
 
 #ifndef lint
 static const char rcsid[] =
-    "@(#) $Header: /tcpdump/master/tcpdump/print-isakmp.c,v 1.33 2002-09-05 00:00:13 guy Exp $ (LBL)";
+    "@(#) $Header: /tcpdump/master/tcpdump/print-isakmp.c,v 1.34 2002-09-05 00:43:21 guy Exp $ (LBL)";
 #endif
 
 #ifdef HAVE_CONFIG_H
@@ -59,38 +59,38 @@ static const char rcsid[] =
 #define sockaddr_storage sockaddr
 #endif
 
-static u_char *isakmp_sa_print(struct isakmp_gen *, u_char *, u_int32_t,
-       u_int32_t, u_int32_t);
-static u_char *isakmp_p_print(struct isakmp_gen *, u_char *, u_int32_t,
-       u_int32_t, u_int32_t);
-static u_char *isakmp_t_print(struct isakmp_gen *, u_char *, u_int32_t,
-       u_int32_t, u_int32_t);
-static u_char *isakmp_ke_print(struct isakmp_gen *, u_char *, u_int32_t,
-       u_int32_t, u_int32_t);
-static u_char *isakmp_id_print(struct isakmp_gen *, u_char *, u_int32_t,
-       u_int32_t, u_int32_t);
-static u_char *isakmp_cert_print(struct isakmp_gen *, u_char *, u_int32_t,
-       u_int32_t, u_int32_t);
-static u_char *isakmp_cr_print(struct isakmp_gen *, u_char *, u_int32_t,
-       u_int32_t, u_int32_t);
-static u_char *isakmp_sig_print(struct isakmp_gen *, u_char *, u_int32_t,
-       u_int32_t, u_int32_t);
-static u_char *isakmp_hash_print(struct isakmp_gen *, u_char *,
-       u_int32_t, u_int32_t, u_int32_t);
-static u_char *isakmp_nonce_print(struct isakmp_gen *, u_char *,
-       u_int32_t, u_int32_t, u_int32_t);
-static u_char *isakmp_n_print(struct isakmp_gen *, u_char *, u_int32_t,
-       u_int32_t, u_int32_t);
-static u_char *isakmp_d_print(struct isakmp_gen *, u_char *, u_int32_t,
-       u_int32_t, u_int32_t);
-static u_char *isakmp_vid_print(struct isakmp_gen *, u_char *, u_int32_t,
-       u_int32_t, u_int32_t);
-static u_char *isakmp_sub0_print(u_char, struct isakmp_gen *, u_char *,
-       u_int32_t, u_int32_t, u_int32_t);
-static u_char *isakmp_sub_print(u_char, struct isakmp_gen *, u_char *,
-       u_int32_t, u_int32_t, u_int32_t);
+static const u_char *isakmp_sa_print(const struct isakmp_gen *,
+       const u_char *, u_int32_t, u_int32_t, u_int32_t, int);
+static const u_char *isakmp_p_print(const struct isakmp_gen *,
+       const u_char *, u_int32_t, u_int32_t, u_int32_t, int);
+static const u_char *isakmp_t_print(const struct isakmp_gen *,
+       const u_char *, u_int32_t, u_int32_t, u_int32_t, int);
+static const u_char *isakmp_ke_print(const struct isakmp_gen *,
+       const u_char *, u_int32_t, u_int32_t, u_int32_t, int);
+static const u_char *isakmp_id_print(const struct isakmp_gen *,
+       const u_char *, u_int32_t, u_int32_t, u_int32_t, int);
+static const u_char *isakmp_cert_print(const struct isakmp_gen *,
+       const u_char *, u_int32_t, u_int32_t, u_int32_t, int);
+static const u_char *isakmp_cr_print(const struct isakmp_gen *,
+       const u_char *, u_int32_t, u_int32_t, u_int32_t, int);
+static const u_char *isakmp_sig_print(const struct isakmp_gen *,
+       const u_char *, u_int32_t, u_int32_t, u_int32_t, int);
+static const u_char *isakmp_hash_print(const struct isakmp_gen *,
+       const u_char *, u_int32_t, u_int32_t, u_int32_t, int);
+static const u_char *isakmp_nonce_print(const struct isakmp_gen *,
+       const u_char *, u_int32_t, u_int32_t, u_int32_t, int);
+static const u_char *isakmp_n_print(const struct isakmp_gen *,
+       const u_char *, u_int32_t, u_int32_t, u_int32_t, int);
+static const u_char *isakmp_d_print(const struct isakmp_gen *,
+       const u_char *, u_int32_t, u_int32_t, u_int32_t, int);
+static const u_char *isakmp_vid_print(const struct isakmp_gen *,
+       const u_char *, u_int32_t, u_int32_t, u_int32_t, int);
+static const u_char *isakmp_sub0_print(u_char, const struct isakmp_gen *,
+       const u_char *, u_int32_t, u_int32_t, u_int32_t, int);
+static const u_char *isakmp_sub_print(u_char, const struct isakmp_gen *,
+       const u_char *, u_int32_t, u_int32_t, u_int32_t, int);
 static char *numstr(int);
-static void safememcpy(void *, void *, size_t);
+static void safememcpy(void *, const void *, size_t);
 
 #define MAXINITIATORS  20
 int ninitiator = 0;
@@ -112,8 +112,8 @@ static const char *npstr[] = {
 };
 
 /* isakmp->np */
-static u_char *(*npfunc[])(struct isakmp_gen *, u_char *, u_int32_t,
-               u_int32_t, u_int32_t) = {
+static const u_char *(*npfunc[])(const struct isakmp_gen *, const u_char *,
+               u_int32_t, u_int32_t, u_int32_t, int) = {
        NULL,
        isakmp_sa_print,
        isakmp_p_print,
@@ -338,8 +338,9 @@ struct attrmap {
        const char *value[30];  /*XXX*/
 };
 
-static u_char *
-isakmp_attrmap_print(u_char *p, u_char *ep, struct attrmap *map, size_t nmap)
+static const u_char *
+isakmp_attrmap_print(const u_char *p, const u_char *ep,
+       const struct attrmap *map, size_t nmap)
 {
        u_int16_t *q;
        int totlen;
@@ -376,8 +377,8 @@ isakmp_attrmap_print(u_char *p, u_char *ep, struct attrmap *map, size_t nmap)
        return p + totlen;
 }
 
-static u_char *
-isakmp_attr_print(u_char *p, u_char *ep)
+static const u_char *
+isakmp_attr_print(const u_char *p, const u_char *ep)
 {
        u_int16_t *q;
        int totlen;
@@ -408,14 +409,15 @@ isakmp_attr_print(u_char *p, u_char *ep)
        return p + totlen;
 }
 
-static u_char *
-isakmp_sa_print(struct isakmp_gen *ext, u_char *ep, u_int32_t phase,
-       u_int32_t doi0, u_int32_t proto0)
+static const u_char *
+isakmp_sa_print(const struct isakmp_gen *ext, const u_char *ep, u_int32_t phase,
+       u_int32_t doi0, u_int32_t proto0, int depth)
 {
-       struct isakmp_pl_sa *p, sa;
-       u_int32_t *q;
+       const struct isakmp_pl_sa *p;
+       struct isakmp_pl_sa sa;
+       const u_int32_t *q;
        u_int32_t doi, sit, ident;
-       u_char *cp, *np;
+       const u_char *cp, *np;
        int t;
 
        printf("%s:", NPSTR(ISAKMP_NPTYPE_SA));
@@ -454,17 +456,19 @@ isakmp_sa_print(struct isakmp_gen *ext, u_char *ep, u_int32_t phase,
 
        ext = (struct isakmp_gen *)np;
 
-       cp = isakmp_sub_print(ISAKMP_NPTYPE_P, ext, ep, phase, doi, proto0);
+       cp = isakmp_sub_print(ISAKMP_NPTYPE_P, ext, ep, phase, doi, proto0,
+               depth);
 
        return cp;
 }
 
-static u_char *
-isakmp_p_print(struct isakmp_gen *ext, u_char *ep, u_int32_t phase,
-       u_int32_t doi0, u_int32_t proto0)
+static const u_char *
+isakmp_p_print(const struct isakmp_gen *ext, const u_char *ep, u_int32_t phase,
+       u_int32_t doi0, u_int32_t proto0, int depth)
 {
-       struct isakmp_pl_p *p, prop;
-       u_char *cp;
+       const struct isakmp_pl_p *p;
+       struct isakmp_pl_p prop;
+       const u_char *cp;
 
        printf("%s:", NPSTR(ISAKMP_NPTYPE_P));
 
@@ -480,7 +484,7 @@ isakmp_p_print(struct isakmp_gen *ext, u_char *ep, u_int32_t phase,
        ext = (struct isakmp_gen *)((u_char *)(p + 1) + prop.spi_size);
 
        cp = isakmp_sub_print(ISAKMP_NPTYPE_T, ext, ep, phase, doi0,
-               prop.prot_id);
+               prop.prot_id, depth);
 
        return cp;
 }
@@ -503,7 +507,7 @@ static const char *ipcomp_p_map[] = {
        NULL, "oui", "deflate", "lzs",
 };
 
-struct attrmap ipsec_t_map[] = {
+const struct attrmap ipsec_t_map[] = {
        { NULL, 0, { NULL } },
        { "lifetype", 3, { NULL, "sec", "kb", }, },
        { "life", 0, { NULL } },
@@ -517,7 +521,7 @@ struct attrmap ipsec_t_map[] = {
        { "privalg", 0, { NULL } },
 };
 
-struct attrmap oakley_t_map[] = {
+const struct attrmap oakley_t_map[] = {
        { NULL, 0, { NULL } },
        { "enc", 8,     { NULL, "1des", "idea", "blowfish", "rc5",
                          "3des", "cast", "aes", }, },
@@ -541,16 +545,17 @@ struct attrmap oakley_t_map[] = {
        { "order", 0, { NULL } },
 };
 
-static u_char *
-isakmp_t_print(struct isakmp_gen *ext, u_char *ep, u_int32_t phase,
-       u_int32_t doi, u_int32_t proto)
+static const u_char *
+isakmp_t_print(const struct isakmp_gen *ext, const u_char *ep, u_int32_t phase,
+       u_int32_t doi, u_int32_t proto, int depth)
 {
-       struct isakmp_pl_t *p, t;
-       u_char *cp;
+       const struct isakmp_pl_t *p;
+       struct isakmp_pl_t t;
+       const u_char *cp;
        const char *idstr;
-       struct attrmap *map;
+       const struct attrmap *map;
        size_t nmap;
-       u_char *ep2;
+       const u_char *ep2;
 
        printf("%s:", NPSTR(ISAKMP_NPTYPE_T));
 
@@ -603,9 +608,9 @@ isakmp_t_print(struct isakmp_gen *ext, u_char *ep, u_int32_t phase,
        return cp;
 }
 
-static u_char *
-isakmp_ke_print(struct isakmp_gen *ext, u_char *ep, u_int32_t phase,
-       u_int32_t doi, u_int32_t proto)
+static const u_char *
+isakmp_ke_print(const struct isakmp_gen *ext, const u_char *ep, u_int32_t phase,
+       u_int32_t doi, u_int32_t proto, int depth)
 {
        struct isakmp_gen e;
 
@@ -620,12 +625,13 @@ isakmp_ke_print(struct isakmp_gen *ext, u_char *ep, u_int32_t phase,
        return (u_char *)ext + ntohs(e.len);
 }
 
-static u_char *
-isakmp_id_print(struct isakmp_gen *ext, u_char *ep, u_int32_t phase,
-       u_int32_t doi, u_int32_t proto)
+static const u_char *
+isakmp_id_print(const struct isakmp_gen *ext, const u_char *ep, u_int32_t phase,
+       u_int32_t doi, u_int32_t proto, int depth)
 {
 #define USE_IPSECDOI_IN_PHASE1 1
-       struct isakmp_pl_id *p, id;
+       const struct isakmp_pl_id *p;
+       struct isakmp_pl_id id;
        static const char *idtypestr[] = {
                "IPv4", "IPv4net", "IPv6", "IPv6net",
        };
@@ -635,7 +641,7 @@ isakmp_id_print(struct isakmp_gen *ext, u_char *ep, u_int32_t phase,
                "keyid",
        };
        int len;
-       u_char *data;
+       const u_char *data;
 
        printf("%s:", NPSTR(ISAKMP_NPTYPE_ID));
 
@@ -665,7 +671,8 @@ isakmp_id_print(struct isakmp_gen *ext, u_char *ep, u_int32_t phase,
 #endif
        case 2:
            {
-               struct ipsecdoi_id *p, id;
+               const struct ipsecdoi_id *p;
+               struct ipsecdoi_id id;
                struct protoent *pe;
 
                p = (struct ipsecdoi_id *)ext;
@@ -705,7 +712,7 @@ isakmp_id_print(struct isakmp_gen *ext, u_char *ep, u_int32_t phase,
                    }
                case IPSECDOI_ID_IPV4_ADDR_SUBNET:
                    {
-                       u_char *mask;
+                       const u_char *mask;
                        mask = data + sizeof(struct in_addr);
                        printf(" len=%d %s/%u.%u.%u.%u", len,
                                ipaddr_string(data),
@@ -720,7 +727,7 @@ isakmp_id_print(struct isakmp_gen *ext, u_char *ep, u_int32_t phase,
                        break;
                case IPSECDOI_ID_IPV6_ADDR_SUBNET:
                    {
-                       u_int32_t *mask;
+                       const u_int32_t *mask;
                        mask = (u_int32_t *)(data + sizeof(struct in6_addr));
                        /*XXX*/
                        printf(" len=%d %s/0x%08x%08x%08x%08x", len,
@@ -760,11 +767,12 @@ isakmp_id_print(struct isakmp_gen *ext, u_char *ep, u_int32_t phase,
        return (u_char *)ext + ntohs(id.h.len);
 }
 
-static u_char *
-isakmp_cert_print(struct isakmp_gen *ext, u_char *ep, u_int32_t phase,
-       u_int32_t doi0, u_int32_t proto0)
+static const u_char *
+isakmp_cert_print(const struct isakmp_gen *ext, const u_char *ep,
+       u_int32_t phase, u_int32_t doi0, u_int32_t proto0, int depth)
 {
-       struct isakmp_pl_cert *p, cert;
+       const struct isakmp_pl_cert *p;
+       struct isakmp_pl_cert cert;
        static const char *certstr[] = {
                "none", "pkcs7", "pgp", "dns",
                "x509sign", "x509ke", "kerberos", "crl",
@@ -784,11 +792,12 @@ isakmp_cert_print(struct isakmp_gen *ext, u_char *ep, u_int32_t phase,
        return (u_char *)ext + ntohs(cert.h.len);
 }
 
-static u_char *
-isakmp_cr_print(struct isakmp_gen *ext, u_char *ep, u_int32_t phase,
-       u_int32_t doi0, u_int32_t proto0)
+static const u_char *
+isakmp_cr_print(const struct isakmp_gen *ext, const u_char *ep, u_int32_t phase,
+       u_int32_t doi0, u_int32_t proto0, int depth)
 {
-       struct isakmp_pl_cert *p, cert;
+       const struct isakmp_pl_cert *p;
+       struct isakmp_pl_cert cert;
        static const char *certstr[] = {
                "none", "pkcs7", "pgp", "dns",
                "x509sign", "x509ke", "kerberos", "crl",
@@ -808,9 +817,9 @@ isakmp_cr_print(struct isakmp_gen *ext, u_char *ep, u_int32_t phase,
        return (u_char *)ext + ntohs(cert.h.len);
 }
 
-static u_char *
-isakmp_hash_print(struct isakmp_gen *ext, u_char *ep, u_int32_t phase,
-       u_int32_t doi, u_int32_t proto)
+static const u_char *
+isakmp_hash_print(const struct isakmp_gen *ext, const u_char *ep,
+       u_int32_t phase, u_int32_t doi, u_int32_t proto, int depth)
 {
        struct isakmp_gen e;
 
@@ -825,9 +834,9 @@ isakmp_hash_print(struct isakmp_gen *ext, u_char *ep, u_int32_t phase,
        return (u_char *)ext + ntohs(e.len);
 }
 
-static u_char *
-isakmp_sig_print(struct isakmp_gen *ext, u_char *ep, u_int32_t phase,
-       u_int32_t doi, u_int32_t proto)
+static const u_char *
+isakmp_sig_print(const struct isakmp_gen *ext, const u_char *ep,
+       u_int32_t phase, u_int32_t doi, u_int32_t proto, int depth)
 {
        struct isakmp_gen e;
 
@@ -842,9 +851,9 @@ isakmp_sig_print(struct isakmp_gen *ext, u_char *ep, u_int32_t phase,
        return (u_char *)ext + ntohs(e.len);
 }
 
-static u_char *
-isakmp_nonce_print(struct isakmp_gen *ext, u_char *ep, u_int32_t phase,
-       u_int32_t doi, u_int32_t proto)
+static const u_char *
+isakmp_nonce_print(const struct isakmp_gen *ext, const u_char *ep,
+       u_int32_t phase, u_int32_t doi, u_int32_t proto, int depth)
 {
        struct isakmp_gen e;
 
@@ -859,12 +868,12 @@ isakmp_nonce_print(struct isakmp_gen *ext, u_char *ep, u_int32_t phase,
        return (u_char *)ext + ntohs(e.len);
 }
 
-static u_char *
-isakmp_n_print(struct isakmp_gen *ext, u_char *ep, u_int32_t phase,
-       u_int32_t doi0, u_int32_t proto0)
+static const u_char *
+isakmp_n_print(const struct isakmp_gen *ext, const u_char *ep, u_int32_t phase,
+       u_int32_t doi0, u_int32_t proto0, int depth)
 {
        struct isakmp_pl_n *p, n;
-       u_char *cp;
+       const u_char *cp;
        u_char *ep2;
        u_int32_t doi;
        u_int32_t proto;
@@ -963,7 +972,7 @@ isakmp_n_print(struct isakmp_gen *ext, u_char *ep, u_int32_t phase,
                switch (ntohs(n.type)) {
                case IPSECDOI_NTYPE_RESPONDER_LIFETIME:
                    {
-                       struct attrmap *map = oakley_t_map;
+                       const struct attrmap *map = oakley_t_map;
                        size_t nmap = sizeof(oakley_t_map)/sizeof(oakley_t_map[0]);
                        while (cp < ep && cp < ep2) {
                                cp = isakmp_attrmap_print(cp,
@@ -976,8 +985,10 @@ isakmp_n_print(struct isakmp_gen *ext, u_char *ep, u_int32_t phase,
                                (*(u_int32_t *)cp) ? "en" : "dis");
                        break;
                case ISAKMP_NTYPE_NO_PROPOSAL_CHOSEN:
-                       isakmp_sub_print(ISAKMP_NPTYPE_SA,
-                               (struct isakmp_gen *)cp, ep, phase, doi, proto);
+                       if (isakmp_sub_print(ISAKMP_NPTYPE_SA,
+                           (struct isakmp_gen *)cp, ep, phase, doi, proto,
+                           depth) == NULL)
+                               return NULL;
                        break;
                default:
                        /* NULL is dummy */
@@ -990,12 +1001,13 @@ isakmp_n_print(struct isakmp_gen *ext, u_char *ep, u_int32_t phase,
        return (u_char *)ext + ntohs(n.h.len);
 }
 
-static u_char *
-isakmp_d_print(struct isakmp_gen *ext, u_char *ep, u_int32_t phase,
-       u_int32_t doi0, u_int32_t proto0)
+static const u_char *
+isakmp_d_print(const struct isakmp_gen *ext, const u_char *ep, u_int32_t phase,
+       u_int32_t doi0, u_int32_t proto0, int depth)
 {
-       struct isakmp_pl_d *p, d;
-       u_int8_t *q;
+       const struct isakmp_pl_d *p;
+       struct isakmp_pl_d d;
+       const u_int8_t *q;
        u_int32_t doi;
        u_int32_t proto;
        int i;
@@ -1026,9 +1038,9 @@ isakmp_d_print(struct isakmp_gen *ext, u_char *ep, u_int32_t phase,
        return q;
 }
 
-static u_char *
-isakmp_vid_print(struct isakmp_gen *ext, u_char *ep, u_int32_t phase,
-       u_int32_t doi, u_int32_t proto)
+static const u_char *
+isakmp_vid_print(const struct isakmp_gen *ext, const u_char *ep,
+       u_int32_t phase, u_int32_t doi, u_int32_t proto, int depth)
 {
        struct isakmp_gen e;
 
@@ -1043,35 +1055,45 @@ isakmp_vid_print(struct isakmp_gen *ext, u_char *ep, u_int32_t phase,
        return (u_char *)ext + ntohs(e.len);
 }
 
-static u_char *
-isakmp_sub0_print(u_char np, struct isakmp_gen *ext, u_char *ep,
-       u_int32_t phase, u_int32_t doi, u_int32_t proto)
+static const u_char *
+isakmp_sub0_print(u_char np, const struct isakmp_gen *ext, const u_char *ep,
+       u_int32_t phase, u_int32_t doi, u_int32_t proto, int depth)
 {
-       u_char *cp;
+       const u_char *cp;
        struct isakmp_gen e;
+       u_int item_len;
 
        cp = (u_char *)ext;
        safememcpy(&e, ext, sizeof(e));
 
        if (NPFUNC(np))
-               cp = (*NPFUNC(np))(ext, ep, phase, doi, proto);
+               cp = (*NPFUNC(np))(ext, ep, phase, doi, proto, depth);
        else {
                printf("%s", NPSTR(np));
-               cp += ntohs(e.len);
+               item_len = ntohs(e.len);
+               if (item_len == 0) {
+                       /*
+                        * We don't want to loop forever processing this
+                        * bogus (zero-length) item; return NULL so that
+                        * we stop dissecting.
+                        */
+                       cp = NULL;
+               } else
+                       cp += item_len;
        }
+
        return cp;
 }
 
-static u_char *
-isakmp_sub_print(u_char np, struct isakmp_gen *ext, u_char *ep,
-       u_int32_t phase, u_int32_t doi, u_int32_t proto)
+static const u_char *
+isakmp_sub_print(u_char np, const struct isakmp_gen *ext, const u_char *ep,
+       u_int32_t phase, u_int32_t doi, u_int32_t proto, int depth)
 {
-       u_char *cp;
-       static int depth = 0;
+       const u_char *cp;
        int i;
        struct isakmp_gen e;
 
-       cp = (u_char *)ext;
+       cp = (const u_char *)ext;
 
        while (np) {
                safememcpy(&e, ext, sizeof(e));
@@ -1086,10 +1108,15 @@ isakmp_sub_print(u_char np, struct isakmp_gen *ext, u_char *ep,
                for (i = 0; i < depth; i++)
                        printf("    ");
                printf("(");
-               cp = isakmp_sub0_print(np, ext, ep, phase, doi, proto);
+               cp = isakmp_sub0_print(np, ext, ep, phase, doi, proto, depth);
                printf(")");
                depth--;
 
+               if (cp == NULL) {
+                       /* Zero-length subitem */
+                       return NULL;
+               }
+
                np = e.np;
                ext = (struct isakmp_gen *)cp;
        }
@@ -1110,7 +1137,7 @@ numstr(int x)
  * optimization.
  */
 static void
-safememcpy(void *p, void *q, size_t l)
+safememcpy(void *p, const void *q, size_t l)
 {
        memcpy(p, q, l);
 }
@@ -1118,15 +1145,16 @@ safememcpy(void *p, void *q, size_t l)
 void
 isakmp_print(const u_char *bp, u_int length, const u_char *bp2)
 {
-       struct isakmp *p, base;
-       u_char *ep;
+       const struct isakmp *p;
+       struct isakmp base;
+       const u_char *ep;
        u_char np;
        int i;
        int phase;
        int major, minor;
 
-       p = (struct isakmp *)bp;
-       ep = (u_char *)snapend;
+       p = (const struct isakmp *)bp;
+       ep = snapend;
 
        if ((struct isakmp *)ep < p + 1) {
                printf("[|isakmp]");
@@ -1189,7 +1217,7 @@ isakmp_print(const u_char *bp, u_int length, const u_char *bp2)
        printf(":");
 
     {
-       struct isakmp_gen *ext;
+       const struct isakmp_gen *ext;
        int nparen;
 
 #define CHECKLEN(p, np) \
@@ -1213,7 +1241,7 @@ isakmp_print(const u_char *bp, u_int length, const u_char *bp2)
 
        np = base.np;
        ext = (struct isakmp_gen *)(p + 1);
-       isakmp_sub_print(np, ext, ep, phase, 0, 0);
+       isakmp_sub_print(np, ext, ep, phase, 0, 0, 0);
     }
 
 done: