ESP: Remove padding, padding length and next header from the buffer
Moreover:
Fix indentation.
(cherry picked from commit c4c8ea9a2c9f0769034e6c4d418508308032e6e8)
diff --git a/print-esp.c b/print-esp.c
index 8b664b6..61c3e13 100644
--- a/print-esp.c
+++ b/print-esp.c
@@ -903,12 +903,20 @@
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