X-Git-Url: https://git.tcpdump.org/tcpdump/blobdiff_plain/57577610721997e4721c0d02b7860ef31cc399ba..7b4e6191a77bdaff6f04af00b93eafb718b33662:/print-tcp.c diff --git a/print-tcp.c b/print-tcp.c index 12d24b5c..142a2ba9 100644 --- a/print-tcp.c +++ b/print-tcp.c @@ -624,6 +624,13 @@ tcp_print(netdissect_options *ndo, * only do ND_TCHECK_LEN() if it returned 0. */ ND_TCHECK_LEN(cp, datalen); + /* Update the snapend to the end of the option + * before calling mptcp_print(). Some options + * (MPTCP or others) may be present after a + * MPTCP option. This prevents that, in + * mptcp_print(), the remaining length < the + * remaining caplen. + */ snapend_save = ndo->ndo_snapend; ndo->ndo_snapend = ND_MIN(cp - 2 + len, ndo->ndo_snapend);