summaryrefslogtreecommitdiffhomepage
path: root/pkg/tcpip/transport
diff options
context:
space:
mode:
authorKevin Krakauer <krakauer@google.com>2020-07-13 11:59:26 -0700
committergVisor bot <gvisor-bot@google.com>2020-07-13 12:00:46 -0700
commit43c209f48e0aa9024705583cc6f0fafa7d6380ca (patch)
tree86d22b7950dfcefb07b4b4bc0bb8af7367bc655c /pkg/tcpip/transport
parent76b392bc262d5c0af10b3127b7aad85a4130da78 (diff)
garbage collect connections
As in Linux, we must periodically clean up unused connections. PiperOrigin-RevId: 321003353
Diffstat (limited to 'pkg/tcpip/transport')
-rw-r--r--pkg/tcpip/transport/tcpconntrack/tcp_conntrack.go5
1 files changed, 5 insertions, 0 deletions
diff --git a/pkg/tcpip/transport/tcpconntrack/tcp_conntrack.go b/pkg/tcpip/transport/tcpconntrack/tcp_conntrack.go
index 12bc1b5b5..558b06df0 100644
--- a/pkg/tcpip/transport/tcpconntrack/tcp_conntrack.go
+++ b/pkg/tcpip/transport/tcpconntrack/tcp_conntrack.go
@@ -106,6 +106,11 @@ func (t *TCB) UpdateStateOutbound(tcp header.TCP) Result {
return st
}
+// State returns the current state of the TCB.
+func (t *TCB) State() Result {
+ return t.state
+}
+
// IsAlive returns true as long as the connection is established(Alive)
// or connecting state.
func (t *TCB) IsAlive() bool {