summaryrefslogtreecommitdiff
path: root/print-isakmp.c
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2019-03-28 11:45:43 -0700
committerGuy Harris <guy@alum.mit.edu>2019-03-28 11:45:43 -0700
commit48644533f2fba9a9b4d6e72d3f21f3b5cbcfe438 (patch)
treec5886b1845c760a1c6b84fe2675ad3305110bfa9 /print-isakmp.c
parent400643120a48eca33973f6a47b34f0dcfde4d20a (diff)
downloadtcpdump-48644533f2fba9a9b4d6e72d3f21f3b5cbcfe438.tar.gz
Have esp_print() handle printing its payload.
That cleans things up a bit, including removing some duplicate code. Clean up some other things, and add a length check, while we're at it.
Diffstat (limited to 'print-isakmp.c')
-rw-r--r--print-isakmp.c18
1 files changed, 7 insertions, 11 deletions
diff --git a/print-isakmp.c b/print-isakmp.c
index 0acab5a3..8ad8a60f 100644
--- a/print-isakmp.c
+++ b/print-isakmp.c
@@ -3124,20 +3124,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;
-
- bp += advance;
- length -= advance + padlen;
- nh = enh & 0xff;
+ esp_print(ndo, bp, length, bp2, ver, fragmented, ttl_hl);
- ip_print_demux(ndo, bp, length, ver, fragmented, ttl_hl, 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;
}