diff options
author | Bhasker Hariharan <bhaskerh@google.com> | 2021-02-18 15:58:50 -0800 |
---|---|---|
committer | gVisor bot <gvisor-bot@google.com> | 2021-02-18 16:00:38 -0800 |
commit | ec7f44f36b57c8472a692cdd736ad721c5170ee2 (patch) | |
tree | bc432a0248fd3b7327c630787b15fedef768f9b3 /pkg/sentry | |
parent | f80a857a4f5f57908c64a22f5de0e07df722227d (diff) |
Make socketops reflect correct sndbuf value for host UDS.
Also skips a test if the setsockopt to increase send buffer did not result in an
increase. This is possible when the underlying socket is a host backed unix
domain socket as in such cases gVisor does not permit increasing SO_SNDBUF.
PiperOrigin-RevId: 358285158
Diffstat (limited to 'pkg/sentry')
-rw-r--r-- | pkg/sentry/socket/unix/transport/connectioned.go | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/pkg/sentry/socket/unix/transport/connectioned.go b/pkg/sentry/socket/unix/transport/connectioned.go index 809c95429..b1967fc36 100644 --- a/pkg/sentry/socket/unix/transport/connectioned.go +++ b/pkg/sentry/socket/unix/transport/connectioned.go @@ -364,7 +364,9 @@ func (e *connectionedEndpoint) Connect(ctx context.Context, server BoundEndpoint e.connected = ce // Make sure the newly created connected endpoint's write queue is updated // to reflect this endpoint's send buffer size. - e.connected.SetSendBufferSize(e.ops.GetSendBufferSize()) + if bufSz := e.connected.SetSendBufferSize(e.ops.GetSendBufferSize()); bufSz != e.ops.GetSendBufferSize() { + e.ops.SetSendBufferSize(bufSz, false /* notify */) + } } return server.BidirectionalConnect(ctx, e, returnConnect) |