diff options
author | gVisor bot <gvisor-bot@google.com> | 2020-08-05 04:02:36 +0000 |
---|---|---|
committer | gVisor bot <gvisor-bot@google.com> | 2020-08-05 04:02:36 +0000 |
commit | 98eccbe87765a4e9e84840115af1b1638d6898aa (patch) | |
tree | 81cfb5ad9254b85c41cdbea64d4aa057f498ba13 /pkg/tcpip/transport/tcp/connect.go | |
parent | 26a468e6a6033800b0e731b5859c3d2d8dc1712f (diff) | |
parent | 0e6f7a12c29efa52581c38ca30637b133556a6cf (diff) |
Merge release-20200622.1-336-g0e6f7a12c (automated)
Diffstat (limited to 'pkg/tcpip/transport/tcp/connect.go')
-rw-r--r-- | pkg/tcpip/transport/tcp/connect.go | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/pkg/tcpip/transport/tcp/connect.go b/pkg/tcpip/transport/tcp/connect.go index 6e5e55b6f..8dd759ba2 100644 --- a/pkg/tcpip/transport/tcp/connect.go +++ b/pkg/tcpip/transport/tcp/connect.go @@ -1166,13 +1166,18 @@ func (e *endpoint) handleSegments(fastPath bool) *tcpip.Error { return nil } -// handleSegment handles a given segment and notifies the worker goroutine if -// if the connection should be terminated. -func (e *endpoint) handleSegment(s *segment) (cont bool, err *tcpip.Error) { - // Invoke the tcp probe if installed. +func (e *endpoint) probeSegment() { if e.probe != nil { e.probe(e.completeState()) } +} + +// handleSegment handles a given segment and notifies the worker goroutine if +// if the connection should be terminated. +func (e *endpoint) handleSegment(s *segment) (cont bool, err *tcpip.Error) { + // Invoke the tcp probe if installed. The tcp probe function will update + // the TCPEndpointState after the segment is processed. + defer e.probeSegment() if s.flagIsSet(header.TCPFlagRst) { if ok, err := e.handleReset(s); !ok { |