diff options
author | Ayush Ranjan <ayushranjan@google.com> | 2020-11-18 13:40:23 -0800 |
---|---|---|
committer | gVisor bot <gvisor-bot@google.com> | 2020-11-18 13:42:27 -0800 |
commit | 3e73c519a55191827dcc6e98ea0ffe977acbb73f (patch) | |
tree | 5d21f1bab06977bfe2c36051bcd72cc6d250c159 /pkg/sentry | |
parent | d2b701758d3fb1c39162243521e6b985f8b5ef78 (diff) |
[netstack] Move SO_NO_CHECK option to SocketOptions.
PiperOrigin-RevId: 343146856
Diffstat (limited to 'pkg/sentry')
-rw-r--r-- | pkg/sentry/socket/netstack/netstack.go | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/pkg/sentry/socket/netstack/netstack.go b/pkg/sentry/socket/netstack/netstack.go index 9c927efa0..d48b92c66 100644 --- a/pkg/sentry/socket/netstack/netstack.go +++ b/pkg/sentry/socket/netstack/netstack.go @@ -1232,12 +1232,8 @@ func getSockOptSocket(t *kernel.Task, s socket.SocketOps, ep commonEndpoint, fam return nil, syserr.ErrInvalidArgument } - v, err := ep.GetSockOptBool(tcpip.NoChecksumOption) - if err != nil { - return nil, syserr.TranslateNetstackError(err) - } - vP := primitive.Int32(boolToInt32(v)) - return &vP, nil + v := primitive.Int32(boolToInt32(ep.SocketOptions().GetNoChecksum())) + return &v, nil case linux.SO_ACCEPTCONN: if outLen < sizeOfInt32 { @@ -1977,7 +1973,8 @@ func setSockOptSocket(t *kernel.Task, s socket.SocketOps, ep commonEndpoint, nam } v := usermem.ByteOrder.Uint32(optVal) - return syserr.TranslateNetstackError(ep.SetSockOptBool(tcpip.NoChecksumOption, v != 0)) + ep.SocketOptions().SetNoChecksum(v != 0) + return nil case linux.SO_LINGER: if len(optVal) < linux.SizeOfLinger { |