summaryrefslogtreecommitdiffhomepage
path: root/pkg/sentry/inet/inet.go
diff options
context:
space:
mode:
authorNayana Bidari <nybidari@google.com>2020-08-05 20:45:02 -0700
committergVisor bot <gvisor-bot@google.com>2020-08-05 20:50:06 -0700
commit35312a95c4c8626365b4ece5ffb0bcab44b4bede (patch)
treeecf3ac9def6dcf0e366acfcd2e694a3965edb4dd /pkg/sentry/inet/inet.go
parent7ed4b2b5a6928b3a4a88d0117a764dd4795be61a (diff)
Add loss recovery option for TCP.
/proc/sys/net/ipv4/tcp_recovery is used to enable RACK loss recovery in TCP. PiperOrigin-RevId: 325157807
Diffstat (limited to 'pkg/sentry/inet/inet.go')
-rw-r--r--pkg/sentry/inet/inet.go17
1 files changed, 17 insertions, 0 deletions
diff --git a/pkg/sentry/inet/inet.go b/pkg/sentry/inet/inet.go
index 2916a0644..c0b4831d1 100644
--- a/pkg/sentry/inet/inet.go
+++ b/pkg/sentry/inet/inet.go
@@ -56,6 +56,12 @@ type Stack interface {
// settings.
SetTCPSACKEnabled(enabled bool) error
+ // TCPRecovery returns the TCP loss detection algorithm.
+ TCPRecovery() (TCPLossRecovery, error)
+
+ // SetTCPRecovery attempts to change TCP loss detection algorithm.
+ SetTCPRecovery(recovery TCPLossRecovery) error
+
// Statistics reports stack statistics.
Statistics(stat interface{}, arg string) error
@@ -189,3 +195,14 @@ type StatSNMPUDP [8]uint64
// StatSNMPUDPLite describes UdpLite line of /proc/net/snmp.
type StatSNMPUDPLite [8]uint64
+
+// TCPLossRecovery indicates TCP loss detection and recovery methods to use.
+type TCPLossRecovery int32
+
+// Loss recovery constants from include/net/tcp.h which are used to set
+// /proc/sys/net/ipv4/tcp_recovery.
+const (
+ TCP_RACK_LOSS_DETECTION TCPLossRecovery = 1 << iota
+ TCP_RACK_STATIC_REO_WND
+ TCP_RACK_NO_DUPTHRESH
+)