diff options
author | gVisor bot <gvisor-bot@google.com> | 2021-04-16 23:33:09 +0000 |
---|---|---|
committer | gVisor bot <gvisor-bot@google.com> | 2021-04-16 23:33:09 +0000 |
commit | ed4ffd6b8cc12ae502d8077843d53a630f5cf519 (patch) | |
tree | 5938bf2f31feceaab8bba1649dda5b76f23661bd /pkg/tcpip/transport/tcp | |
parent | 78eafdbaff6332df43d07695068ad4c1af929001 (diff) | |
parent | 32c18f443f567dac21465b3999d1a18b886891d1 (diff) |
Merge release-20210408.0-44-g32c18f443 (automated)
Diffstat (limited to 'pkg/tcpip/transport/tcp')
-rw-r--r-- | pkg/tcpip/transport/tcp/accept.go | 1 | ||||
-rw-r--r-- | pkg/tcpip/transport/tcp/endpoint.go | 4 |
2 files changed, 4 insertions, 1 deletions
diff --git a/pkg/tcpip/transport/tcp/accept.go b/pkg/tcpip/transport/tcp/accept.go index 63c46b1be..4be306434 100644 --- a/pkg/tcpip/transport/tcp/accept.go +++ b/pkg/tcpip/transport/tcp/accept.go @@ -455,6 +455,7 @@ func (e *endpoint) reserveTupleLocked() bool { Dest: dest, } if !e.stack.ReserveTuple(portRes) { + e.stack.Stats().TCP.FailedPortReservations.Increment() return false } diff --git a/pkg/tcpip/transport/tcp/endpoint.go b/pkg/tcpip/transport/tcp/endpoint.go index 9afd2bb7f..bc88e48e9 100644 --- a/pkg/tcpip/transport/tcp/endpoint.go +++ b/pkg/tcpip/transport/tcp/endpoint.go @@ -2251,7 +2251,7 @@ func (e *endpoint) connect(addr tcpip.FullAddress, handshake bool, run bool) tcp panic(err) } } - portOffset := uint16(h.Sum32()) + portOffset := h.Sum32() var twReuse tcpip.TCPTimeWaitReuseOption if err := e.stack.TransportProtocolOption(ProtocolNumber, &twReuse); err != nil { @@ -2362,6 +2362,7 @@ func (e *endpoint) connect(addr tcpip.FullAddress, handshake bool, run bool) tcp e.boundDest = addr return true, nil }); err != nil { + e.stack.Stats().TCP.FailedPortReservations.Increment() return err } } @@ -2685,6 +2686,7 @@ func (e *endpoint) bindLocked(addr tcpip.FullAddress) (err tcpip.Error) { return true, nil }) if err != nil { + e.stack.Stats().TCP.FailedPortReservations.Increment() return err } |