diff options
Diffstat (limited to 'pkg/tcpip')
-rw-r--r-- | pkg/tcpip/transport/tcp/endpoint.go | 4 | ||||
-rw-r--r-- | pkg/tcpip/transport/tcp/tcp_test.go | 6 |
2 files changed, 3 insertions, 7 deletions
diff --git a/pkg/tcpip/transport/tcp/endpoint.go b/pkg/tcpip/transport/tcp/endpoint.go index 50f72bf38..3a7b2d166 100644 --- a/pkg/tcpip/transport/tcp/endpoint.go +++ b/pkg/tcpip/transport/tcp/endpoint.go @@ -2398,10 +2398,6 @@ func (e *endpoint) shutdownLocked(flags tcpip.ShutdownFlags) tcpip.Error { // Listen puts the endpoint in "listen" mode, which allows it to accept // new connections. func (e *endpoint) Listen(backlog int) tcpip.Error { - // Accept one more than the configured listen backlog to keep in parity with - // Linux. Ref, because of missing equality check here: - // https://github.com/torvalds/linux/blob/7acac4b3196/include/net/sock.h#L937 - backlog++ err := e.listen(backlog) if err != nil { if !err.IgnoreStats() { diff --git a/pkg/tcpip/transport/tcp/tcp_test.go b/pkg/tcpip/transport/tcp/tcp_test.go index 9f29a48fb..3750b0691 100644 --- a/pkg/tcpip/transport/tcp/tcp_test.go +++ b/pkg/tcpip/transport/tcp/tcp_test.go @@ -5736,7 +5736,7 @@ func TestListenSynRcvdQueueFull(t *testing.T) { } // Test acceptance. - if err := c.EP.Listen(0); err != nil { + if err := c.EP.Listen(1); err != nil { t.Fatalf("Listen failed: %s", err) } @@ -5837,7 +5837,7 @@ func TestListenBacklogFullSynCookieInUse(t *testing.T) { } // Test for SynCookies usage after filling up the backlog. - if err := c.EP.Listen(0); err != nil { + if err := c.EP.Listen(1); err != nil { t.Fatalf("Listen failed: %s", err) } @@ -6120,7 +6120,7 @@ func TestPassiveFailedConnectionAttemptIncrement(t *testing.T) { if err := c.EP.Bind(tcpip.FullAddress{Addr: context.StackAddr, Port: context.StackPort}); err != nil { t.Fatalf("Bind failed: %s", err) } - if err := c.EP.Listen(0); err != nil { + if err := c.EP.Listen(1); err != nil { t.Fatalf("Listen failed: %s", err) } |