]> The Tcpdump Group git mirrors - tcpdump/blobdiff - print-isakmp.c
Clean up comments.
[tcpdump] / print-isakmp.c
index e85f64f87783a2b12009309a5d3c604b2aef15cc..b7b05116d08ce304936349e6def529ce4869cff1 100644 (file)
@@ -635,8 +635,8 @@ ikev1_print(netdissect_options *ndo,
 #define MAXINITIATORS  20
 static int ninitiator = 0;
 union inaddr_u {
-       struct in_addr in4;
-       struct in6_addr in6;
+       nd_ipv4 in4;
+       nd_ipv6 in6;
 };
 static struct {
        cookie_t initiator;
@@ -2697,6 +2697,13 @@ ikev2_e_print(netdissect_options *ndo,
                /* got it decrypted, print stuff inside. */
                ikev2_sub_print(ndo, base, np, ext,
                                ndo->ndo_snapend, phase, doi, proto, depth+1);
+
+               /*
+                * esp_print_decrypt_buffer_by_ikev2 pushed information
+                * on the buffer stack; we're done with the buffer, so
+                * pop it (which frees the buffer)
+                */
+               nd_pop_packet_info(ndo);
        }
 #endif
 
@@ -2813,7 +2820,7 @@ static char *
 numstr(u_int x)
 {
        static char buf[20];
-       nd_snprintf(buf, sizeof(buf), "#%u", x);
+       snprintf(buf, sizeof(buf), "#%u", x);
        return buf;
 }
 
@@ -3099,7 +3106,7 @@ isakmp_print(netdissect_options *ndo,
 void
 isakmp_rfc3948_print(netdissect_options *ndo,
                     const u_char *bp, u_int length,
-                    const u_char *bp2)
+                    const u_char *bp2, int ver, int fragmented, u_int ttl_hl)
 {
        ndo->ndo_protocol = "isakmp_rfc3948";
        ND_TCHECK_1(bp);
@@ -3124,20 +3131,16 @@ isakmp_rfc3948_print(netdissect_options *ndo,
 
        /* must be an ESP packet */
        {
-               u_int nh, enh, padlen;
-               int advance;
-
                ND_PRINT("UDP-encap: ");
 
-               advance = esp_print(ndo, bp, length, bp2, &enh, &padlen);
-               if(advance <= 0)
-                       return;
+               esp_print(ndo, bp, length, bp2, ver, fragmented, ttl_hl);
 
-               bp += advance;
-               length -= advance + padlen;
-               nh = enh & 0xff;
-
-               ip_inner_print(ndo, bp, length, nh, bp2);
+               /*
+                * Either this has decrypted the payload and
+                * printed it, in which case there's nothing more
+                * to do, or it hasn't, in which case there's
+                * nothing more to do.
+                */
                return;
        }