summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorgVisor bot <gvisor-bot@google.com>2021-03-15 19:20:55 +0000
committergVisor bot <gvisor-bot@google.com>2021-03-15 19:20:55 +0000
commit7ac52482a3e5997d33b9baa53e0c931027f7a455 (patch)
tree71dbb72674bd31cbbccdc63fd35ee55f9f84cf77
parentc93afde48bbe29c71c9755223f2a9ce25bd2e644 (diff)
parent48915d17df956a289e12f7bc81be8619ac13ea0a (diff)
Merge release-20210309.0-25-g48915d17d (automated)
-rw-r--r--pkg/sentry/socket/unix/transport/unix.go12
1 files changed, 7 insertions, 5 deletions
diff --git a/pkg/sentry/socket/unix/transport/unix.go b/pkg/sentry/socket/unix/transport/unix.go
index 359a5995b..089a0a647 100644
--- a/pkg/sentry/socket/unix/transport/unix.go
+++ b/pkg/sentry/socket/unix/transport/unix.go
@@ -816,19 +816,20 @@ func (e *baseEndpoint) Connected() bool {
func (e *baseEndpoint) RecvMsg(ctx context.Context, data [][]byte, creds bool, numRights int, peek bool, addr *tcpip.FullAddress) (int64, int64, ControlMessages, bool, *syserr.Error) {
e.Lock()
- if e.receiver == nil {
+ receiver := e.receiver
+ if receiver == nil {
e.Unlock()
return 0, 0, ControlMessages{}, false, syserr.ErrNotConnected
}
- recvLen, msgLen, cms, cmt, a, notify, err := e.receiver.Recv(ctx, data, creds, numRights, peek)
+ recvLen, msgLen, cms, cmt, a, notify, err := receiver.Recv(ctx, data, creds, numRights, peek)
e.Unlock()
if err != nil {
return 0, 0, ControlMessages{}, false, err
}
if notify {
- e.receiver.RecvNotify()
+ receiver.RecvNotify()
}
if addr != nil {
@@ -850,11 +851,12 @@ func (e *baseEndpoint) SendMsg(ctx context.Context, data [][]byte, c ControlMess
return 0, syserr.ErrAlreadyConnected
}
- n, notify, err := e.connected.Send(ctx, data, c, tcpip.FullAddress{Addr: tcpip.Address(e.path)})
+ connected := e.connected
+ n, notify, err := connected.Send(ctx, data, c, tcpip.FullAddress{Addr: tcpip.Address(e.path)})
e.Unlock()
if notify {
- e.connected.SendNotify()
+ connected.SendNotify()
}
return n, err