summaryrefslogtreecommitdiffhomepage
path: root/pkg/tcpip/transport
diff options
context:
space:
mode:
authorgVisor bot <gvisor-bot@google.com>2021-10-12 23:31:33 +0000
committergVisor bot <gvisor-bot@google.com>2021-10-12 23:31:33 +0000
commit3173b380dd462bc4cd156c505b0e31024e100487 (patch)
tree8b21bf8ca949c123711fda99a6df1654a8965aeb /pkg/tcpip/transport
parentee1f7a34b7df34e0e37e3662cbc31ecfcd36df90 (diff)
parente54ee7a990753ba0616b9dc6010323f5a411cb5f (diff)
Merge release-20210927.0-64-ge54ee7a99 (automated)
Diffstat (limited to 'pkg/tcpip/transport')
-rw-r--r--pkg/tcpip/transport/tcp/endpoint.go7
-rw-r--r--pkg/tcpip/transport/tcp/protocol.go12
2 files changed, 15 insertions, 4 deletions
diff --git a/pkg/tcpip/transport/tcp/endpoint.go b/pkg/tcpip/transport/tcp/endpoint.go
index 6a798e980..066ffe051 100644
--- a/pkg/tcpip/transport/tcp/endpoint.go
+++ b/pkg/tcpip/transport/tcp/endpoint.go
@@ -813,10 +813,9 @@ func newEndpoint(s *stack.Stack, protocol *protocol, netProto tcpip.NetworkProto
waiterQueue: waiterQueue,
state: uint32(StateInitial),
keepalive: keepalive{
- // Linux defaults.
- idle: 2 * time.Hour,
- interval: 75 * time.Second,
- count: 9,
+ idle: DefaultKeepaliveIdle,
+ interval: DefaultKeepaliveInterval,
+ count: DefaultKeepaliveCount,
},
uniqueID: s.UniqueID(),
txHash: s.Rand().Uint32(),
diff --git a/pkg/tcpip/transport/tcp/protocol.go b/pkg/tcpip/transport/tcp/protocol.go
index e4410ad93..f122ea009 100644
--- a/pkg/tcpip/transport/tcp/protocol.go
+++ b/pkg/tcpip/transport/tcp/protocol.go
@@ -66,6 +66,18 @@ const (
// DefaultSynRetries is the default value for the number of SYN retransmits
// before a connect is aborted.
DefaultSynRetries = 6
+
+ // DefaultKeepaliveIdle is the idle time for a connection before keep-alive
+ // probes are sent.
+ DefaultKeepaliveIdle = 2 * time.Hour
+
+ // DefaultKeepaliveInterval is the time between two successive keep-alive
+ // probes.
+ DefaultKeepaliveInterval = 75 * time.Second
+
+ // DefaultKeepaliveCount is the number of keep-alive probes that are sent
+ // before declaring the connection dead.
+ DefaultKeepaliveCount = 9
)
const (