diff options
author | Mithun Iyer <iyerm@google.com> | 2021-05-04 19:15:27 -0700 |
---|---|---|
committer | gVisor bot <gvisor-bot@google.com> | 2021-05-04 19:18:02 -0700 |
commit | d384378077f29c05c99820042f7cd677e8bf1efa (patch) | |
tree | 4c95417842df7d2a5dedf4036701c439e571ac1f /pkg/tcpip | |
parent | 5960674c8fe086413c3ef88b29fbb4c6f4c4ca3f (diff) |
Fix tcp_test listen backlog expectation
Listen backlog value is 1 more than what is configured by the socket
layer listen call. TestListenBacklogFull expects this behavior which
is incorrect as it directly invokes endpoint Listen and with
cl/369974744, backlog++ logic is moved to the callers of Listen().
This test passes sometimes, because the handshakes could overlap causing
the last SYN to arrive at the listener before the previous handshake is
enqueued to the accept queue. In such a case the accept queue is still
not full and the SYN is replied to. The final ACK of this last handshake
would get dropped eventually.
PiperOrigin-RevId: 372041827
Diffstat (limited to 'pkg/tcpip')
-rw-r--r-- | pkg/tcpip/transport/tcp/tcp_test.go | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/pkg/tcpip/transport/tcp/tcp_test.go b/pkg/tcpip/transport/tcp/tcp_test.go index aca34c4c1..8219f52bc 100644 --- a/pkg/tcpip/transport/tcp/tcp_test.go +++ b/pkg/tcpip/transport/tcp/tcp_test.go @@ -5428,7 +5428,7 @@ func TestListenBacklogFull(t *testing.T) { } lastPortOffset := uint16(0) - for ; int(lastPortOffset) < listenBacklog+1; lastPortOffset++ { + for ; int(lastPortOffset) < listenBacklog; lastPortOffset++ { executeHandshake(t, c, context.TestPort+lastPortOffset, false /*synCookieInUse */) } |