]> The Tcpdump Group git mirrors - tcpdump/commitdiff
TCP: Add a comment
authorFrancois-Xavier Le Bail <[email protected]>
Tue, 16 Feb 2021 20:01:27 +0000 (21:01 +0100)
committerFrancois-Xavier Le Bail <[email protected]>
Tue, 16 Feb 2021 20:06:28 +0000 (21:06 +0100)
This is a follow-up to commit 568d18f6eafb8df0d2500652b1cad49618051349.

[skip ci]

print-tcp.c

index 12d24b5ca3a3552e002e4113f384d213bee72f0e..142a2ba9ff31cffa5938034f6fe1bcb23f3a747f 100644 (file)
@@ -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);