aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorFlorin Coras <fcoras@cisco.com>2019-08-29 18:33:24 -0700
committerAndrew Yourtchenko <ayourtch@gmail.com>2019-09-28 20:15:44 +0000
commita2c0637129f0c642a4d55df297bb353243ca7a49 (patch)
treec25e6d57c479dbd5b6230a503f308e245a438333 /src
parent6cf2fde9bb1dda74f8dcc2d96a17d6875cc1c9db (diff)
tcp: track zero rwnd errors
Type: feature Distinguish between rcv window errors and errors after we advertised a zero rcv window, i.e., potential window probes. Change-Id: I6cb453c7aaae456c0a05a8328cfaa55eaca10bf7 Signed-off-by: Florin Coras <fcoras@cisco.com> (cherry picked from commit a495a3ea146a8484dac9f6b594fb2b044437c7a4)
Diffstat (limited to 'src')
-rw-r--r--src/vnet/tcp/tcp_error.def3
-rwxr-xr-xsrc/vnet/tcp/tcp_input.c7
2 files changed, 9 insertions, 1 deletions
diff --git a/src/vnet/tcp/tcp_error.def b/src/vnet/tcp/tcp_error.def
index 7dbe952e104..5acc576e3cb 100644
--- a/src/vnet/tcp/tcp_error.def
+++ b/src/vnet/tcp/tcp_error.def
@@ -48,4 +48,5 @@ tcp_error (OPTIONS, "Could not parse options")
tcp_error (PAWS, "PAWS check failed")
tcp_error (RCV_WND, "Segment not in receive window")
tcp_error (FIN_RCVD, "FINs received")
-tcp_error (LINK_LOCAL_RW, "No rewrite for link local connection") \ No newline at end of file
+tcp_error (LINK_LOCAL_RW, "No rewrite for link local connection")
+tcp_error (ZERO_RWND, "Zero receive window") \ No newline at end of file
diff --git a/src/vnet/tcp/tcp_input.c b/src/vnet/tcp/tcp_input.c
index 0b1ac73209b..45a40a276b0 100755
--- a/src/vnet/tcp/tcp_input.c
+++ b/src/vnet/tcp/tcp_input.c
@@ -365,6 +365,13 @@ tcp_segment_validate (tcp_worker_ctx_t * wrk, tcp_connection_t * tc0,
*error0 = TCP_ERROR_RCV_WND;
+ /* If we advertised a zero rcv_wnd and the segment is in the past or the
+ * next one that we expect, it is probably a window probe */
+ if ((tc0->flags & TCP_CONN_ZERO_RWND_SENT)
+ && seq_lt (vnet_buffer (b0)->tcp.seq_end,
+ tc0->rcv_las + tc0->rcv_opts.mss))
+ *error0 = TCP_ERROR_ZERO_RWND;
+
tc0->errors.below_data_wnd += seq_lt (vnet_buffer (b0)->tcp.seq_end,
tc0->rcv_las);