diff options
author | gVisor bot <gvisor-bot@google.com> | 2020-01-30 00:06:06 +0000 |
---|---|---|
committer | gVisor bot <gvisor-bot@google.com> | 2020-01-30 00:06:06 +0000 |
commit | 08f51fce5ec3e2ad32fa51ab5c0e5c8b01a8fba2 (patch) | |
tree | 5b0bddbed3ce8679fdcfe61b6839bbc8ff4e294c /pkg/sentry/socket | |
parent | 69ab6277c5d906f1677578ad9248819ed183e3ba (diff) | |
parent | 51b783505b1ec164b02b48a0fd234509fba01a73 (diff) |
Merge release-20200127.0-31-g51b7835 (automated)
Diffstat (limited to 'pkg/sentry/socket')
-rwxr-xr-x | pkg/sentry/socket/netstack/netstack.go | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/pkg/sentry/socket/netstack/netstack.go b/pkg/sentry/socket/netstack/netstack.go index 8619cc506..049d04bf2 100755 --- a/pkg/sentry/socket/netstack/netstack.go +++ b/pkg/sentry/socket/netstack/netstack.go @@ -1260,6 +1260,18 @@ func getSockOptTCP(t *kernel.Task, ep commonEndpoint, name, outLen int) (interfa return int32(time.Duration(v) / time.Second), nil + case linux.TCP_DEFER_ACCEPT: + if outLen < sizeOfInt32 { + return nil, syserr.ErrInvalidArgument + } + + var v tcpip.TCPDeferAcceptOption + if err := ep.GetSockOpt(&v); err != nil { + return nil, syserr.TranslateNetstackError(err) + } + + return int32(time.Duration(v) / time.Second), nil + default: emitUnimplementedEventTCP(t, name) } @@ -1713,6 +1725,16 @@ func setSockOptTCP(t *kernel.Task, ep commonEndpoint, name int, optVal []byte) * v := usermem.ByteOrder.Uint32(optVal) return syserr.TranslateNetstackError(ep.SetSockOpt(tcpip.TCPLingerTimeoutOption(time.Second * time.Duration(v)))) + case linux.TCP_DEFER_ACCEPT: + if len(optVal) < sizeOfInt32 { + return syserr.ErrInvalidArgument + } + v := int32(usermem.ByteOrder.Uint32(optVal)) + if v < 0 { + v = 0 + } + return syserr.TranslateNetstackError(ep.SetSockOpt(tcpip.TCPDeferAcceptOption(time.Second * time.Duration(v)))) + case linux.TCP_REPAIR_OPTIONS: t.Kernel().EmitUnimplementedEvent(t) |