diff options
author | gVisor bot <gvisor-bot@google.com> | 2020-08-06 03:53:13 +0000 |
---|---|---|
committer | gVisor bot <gvisor-bot@google.com> | 2020-08-06 03:53:13 +0000 |
commit | 7a92c8c07651ce7f6e78df9e4e4fef5fdf1d75d5 (patch) | |
tree | 86bc61f57003ef5b6bb6b03fd927cdc5cd8bb934 /pkg/sentry/socket/netstack | |
parent | 223374a244992c635fde3e326e7e96f5bcd0e545 (diff) | |
parent | 35312a95c4c8626365b4ece5ffb0bcab44b4bede (diff) |
Merge release-20200804.0-27-g35312a95c (automated)
Diffstat (limited to 'pkg/sentry/socket/netstack')
-rw-r--r-- | pkg/sentry/socket/netstack/stack.go | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/pkg/sentry/socket/netstack/stack.go b/pkg/sentry/socket/netstack/stack.go index 67737ae87..f0fe18684 100644 --- a/pkg/sentry/socket/netstack/stack.go +++ b/pkg/sentry/socket/netstack/stack.go @@ -207,6 +207,20 @@ func (s *Stack) SetTCPSACKEnabled(enabled bool) error { return syserr.TranslateNetstackError(s.Stack.SetTransportProtocolOption(tcp.ProtocolNumber, tcp.SACKEnabled(enabled))).ToError() } +// TCPRecovery implements inet.Stack.TCPRecovery. +func (s *Stack) TCPRecovery() (inet.TCPLossRecovery, error) { + var recovery tcp.Recovery + if err := s.Stack.TransportProtocolOption(tcp.ProtocolNumber, &recovery); err != nil { + return 0, syserr.TranslateNetstackError(err).ToError() + } + return inet.TCPLossRecovery(recovery), nil +} + +// SetTCPRecovery implements inet.Stack.SetTCPRecovery. +func (s *Stack) SetTCPRecovery(recovery inet.TCPLossRecovery) error { + return syserr.TranslateNetstackError(s.Stack.SetTransportProtocolOption(tcp.ProtocolNumber, tcp.Recovery(recovery))).ToError() +} + // Statistics implements inet.Stack.Statistics. func (s *Stack) Statistics(stat interface{}, arg string) error { switch stats := stat.(type) { |