From 48644533f2fba9a9b4d6e72d3f21f3b5cbcfe438 Mon Sep 17 00:00:00 2001 From: Guy Harris Date: Thu, 28 Mar 2019 11:45:43 -0700 Subject: 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. --- print-isakmp.c | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) (limited to 'print-isakmp.c') 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; } -- cgit v1.2.1