diff options
author | Nayana Bidari <nybidari@google.com> | 2021-04-20 09:30:57 -0700 |
---|---|---|
committer | gVisor bot <gvisor-bot@google.com> | 2021-04-20 09:32:54 -0700 |
commit | 3fff4c4a0fbb1b132348d4b82f61cc38a4cc6cb2 (patch) | |
tree | da915516951c72c4db76f02ce1b6dff3075bec6e /pkg/sentry/fsimpl/host | |
parent | 2c8379d95738bb2bc10d2cc7cead6889379e244c (diff) |
Move SO_RCVBUF to socketops.
Fixes #2926, #674
PiperOrigin-RevId: 369457123
Diffstat (limited to 'pkg/sentry/fsimpl/host')
-rw-r--r-- | pkg/sentry/fsimpl/host/socket.go | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/pkg/sentry/fsimpl/host/socket.go b/pkg/sentry/fsimpl/host/socket.go index bc2f62d2f..ca85f5601 100644 --- a/pkg/sentry/fsimpl/host/socket.go +++ b/pkg/sentry/fsimpl/host/socket.go @@ -333,8 +333,16 @@ func (c *ConnectedEndpoint) CloseUnread() {} // SetSendBufferSize implements transport.ConnectedEndpoint.SetSendBufferSize. func (c *ConnectedEndpoint) SetSendBufferSize(v int64) (newSz int64) { - // gVisor does not permit setting of SO_SNDBUF for host backed unix domain - // sockets. + // gVisor does not permit setting of SO_SNDBUF for host backed unix + // domain sockets. + return atomic.LoadInt64(&c.sndbuf) +} + +// SetReceiveBufferSize implements transport.ConnectedEndpoint.SetReceiveBufferSize. +func (c *ConnectedEndpoint) SetReceiveBufferSize(v int64) (newSz int64) { + // gVisor does not permit setting of SO_RCVBUF for host backed unix + // domain sockets. Receive buffer does not have any effect for unix + // sockets and we claim to be the same as send buffer. return atomic.LoadInt64(&c.sndbuf) } |