diff options
author | gVisor bot <gvisor-bot@google.com> | 2021-04-09 23:58:58 +0000 |
---|---|---|
committer | gVisor bot <gvisor-bot@google.com> | 2021-04-09 23:58:58 +0000 |
commit | 4c57ae1fda3e3ae786efc905665bd3aa7b09a730 (patch) | |
tree | d828dff42ef4e45c57e8154c3769155efe37100c /pkg/tcpip/transport/tcp/endpoint.go | |
parent | 3ea260608d063504e553a7c21e4bf0959db2e1bc (diff) | |
parent | dc8f6c6914747c700a629b7717e45759cf1f7650 (diff) |
Merge release-20210408.0-13-gdc8f6c691 (automated)
Diffstat (limited to 'pkg/tcpip/transport/tcp/endpoint.go')
-rw-r--r-- | pkg/tcpip/transport/tcp/endpoint.go | 18 |
1 files changed, 4 insertions, 14 deletions
diff --git a/pkg/tcpip/transport/tcp/endpoint.go b/pkg/tcpip/transport/tcp/endpoint.go index 9438056f9..5001d222e 100644 --- a/pkg/tcpip/transport/tcp/endpoint.go +++ b/pkg/tcpip/transport/tcp/endpoint.go @@ -2474,20 +2474,10 @@ 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 { - if uint32(backlog) > MaxListenBacklog { - // Linux treats incoming backlog as uint with a limit defined by - // sysctl_somaxconn. - // https://github.com/torvalds/linux/blob/7acac4b3196/net/socket.c#L1666 - // - // We use the backlog to allocate a channel of that size, hence enforce - // a hard limit for the backlog. - backlog = MaxListenBacklog - } else { - // 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++ - } + // 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() { |