diff options
author | Nayana Bidari <nybidari@google.com> | 2021-01-26 18:02:53 -0800 |
---|---|---|
committer | gVisor bot <gvisor-bot@google.com> | 2021-01-26 18:05:29 -0800 |
commit | 8e660447410117edd49f41f7aa758e49254ae2d5 (patch) | |
tree | f6e683059d5fdb671b79d3bfdd09a1d6769d1da9 /pkg/sentry/socket/netstack/netstack.go | |
parent | 8bb7d61bdca59b98761b198ec258a6d77441c7ed (diff) |
Initialize the send buffer handler in endpoint creation.
- This CL will initialize the function handler used for getting the send
buffer size limits during endpoint creation and does not require the caller of
SetSendBufferSize(..) to know the endpoint type(tcp/udp/..)
PiperOrigin-RevId: 353992634
Diffstat (limited to 'pkg/sentry/socket/netstack/netstack.go')
-rw-r--r-- | pkg/sentry/socket/netstack/netstack.go | 9 |
1 files changed, 2 insertions, 7 deletions
diff --git a/pkg/sentry/socket/netstack/netstack.go b/pkg/sentry/socket/netstack/netstack.go index b4d0651b8..7065a0e46 100644 --- a/pkg/sentry/socket/netstack/netstack.go +++ b/pkg/sentry/socket/netstack/netstack.go @@ -1615,20 +1615,15 @@ func setSockOptSocket(t *kernel.Task, s socket.SocketOps, ep commonEndpoint, nam return syserr.ErrInvalidArgument } - family, skType, skProto := s.Type() + family, _, _ := s.Type() // TODO(gvisor.dev/issue/5132): We currently do not support // setting this option for unix sockets. if family == linux.AF_UNIX { return nil } - getBufferLimits := tcpip.GetStackSendBufferLimits - if isTCPSocket(skType, skProto) { - getBufferLimits = tcp.GetTCPSendBufferLimits - } - v := usermem.ByteOrder.Uint32(optVal) - ep.SocketOptions().SetSendBufferSize(int64(v), true, getBufferLimits) + ep.SocketOptions().SetSendBufferSize(int64(v), true) return nil case linux.SO_RCVBUF: |