X-Git-Url: https://git.tcpdump.org/tcpdump/blobdiff_plain/3059f3581287981d50bce30480bd1aa98ce73caf..16c95291bde1c04a6e3c31da3b12c3b592d09968:/print-esp.c diff --git a/print-esp.c b/print-esp.c index 8b664b61..61c3e13b 100644 --- a/print-esp.c +++ b/print-esp.c @@ -903,12 +903,20 @@ esp_print(netdissect_options *ndo, ND_PRINT(": "); + /* + * Don't put padding + padding length(1 byte) + next header(1 byte) + * in the buffer because they are not part of the plaintext to decode. + */ + nd_push_snapend(ndo, ep - (padlen + 2)); + /* Now dissect the plaintext. */ ip_demux_print(ndo, pt, payloadlen - (padlen + 2), ver, fragmented, - ttl_hl, nh, bp2); + ttl_hl, nh, bp2); /* Pop the buffer, freeing it. */ nd_pop_packet_info(ndo); + /* Pop the nd_push_snapend */ + nd_pop_packet_info(ndo); #endif } #ifdef HAVE_LIBCRYPTO