diff options
author | gVisor bot <gvisor-bot@google.com> | 2021-09-14 23:07:30 +0000 |
---|---|---|
committer | gVisor bot <gvisor-bot@google.com> | 2021-09-14 23:07:30 +0000 |
commit | bc8649720ff020c7c40825792c94ab9448053749 (patch) | |
tree | 06f446fe224eec8c92bd713ae97729f334229ce1 /pkg/tcpip/link | |
parent | eeb5d2452cbb46b41cb3168069f80fcf10102d45 (diff) |
Merge release-20210906.0-17-g2b46e2d19 (automated)
Diffstat (limited to 'pkg/tcpip/link')
-rw-r--r-- | pkg/tcpip/link/rawfile/blockingpoll_amd64.s | 2 | ||||
-rw-r--r-- | pkg/tcpip/link/rawfile/blockingpoll_arm64.s | 2 | ||||
-rw-r--r-- | pkg/tcpip/link/rawfile/rawfile_unsafe.go | 16 |
3 files changed, 3 insertions, 17 deletions
diff --git a/pkg/tcpip/link/rawfile/blockingpoll_amd64.s b/pkg/tcpip/link/rawfile/blockingpoll_amd64.s index f2c230720..298bad55d 100644 --- a/pkg/tcpip/link/rawfile/blockingpoll_amd64.s +++ b/pkg/tcpip/link/rawfile/blockingpoll_amd64.s @@ -27,7 +27,7 @@ TEXT ·BlockingPoll(SB),NOSPLIT,$0-40 MOVQ $0x0, R10 // sigmask parameter which isn't used here MOVQ $0x10f, AX // SYS_PPOLL SYSCALL - CMPQ AX, $0xfffffffffffff002 + CMPQ AX, $0xfffffffffffff001 JLS ok MOVQ $-1, n+24(FP) NEGQ AX diff --git a/pkg/tcpip/link/rawfile/blockingpoll_arm64.s b/pkg/tcpip/link/rawfile/blockingpoll_arm64.s index 8807586c7..b62888b93 100644 --- a/pkg/tcpip/link/rawfile/blockingpoll_arm64.s +++ b/pkg/tcpip/link/rawfile/blockingpoll_arm64.s @@ -27,7 +27,7 @@ TEXT ·BlockingPoll(SB),NOSPLIT,$0-40 MOVD $0x0, R3 // sigmask parameter which isn't used here MOVD $0x49, R8 // SYS_PPOLL SVC - CMP $0xfffffffffffff002, R0 + CMP $0xfffffffffffff001, R0 BLS ok MOVD $-1, R1 MOVD R1, n+24(FP) diff --git a/pkg/tcpip/link/rawfile/rawfile_unsafe.go b/pkg/tcpip/link/rawfile/rawfile_unsafe.go index 87a0b9a62..e76fc55b6 100644 --- a/pkg/tcpip/link/rawfile/rawfile_unsafe.go +++ b/pkg/tcpip/link/rawfile/rawfile_unsafe.go @@ -181,9 +181,7 @@ func BlockingReadvUntilStopped(efd int, fd int, iovecs []unix.Iovec) (int, tcpip if e == 0 { return int(n), nil } - if e != 0 && e != unix.EWOULDBLOCK { - return 0, TranslateErrno(e) - } + stopped, e := BlockingPollUntilStopped(efd, fd, unix.POLLIN) if stopped { return -1, nil @@ -206,10 +204,6 @@ func BlockingRecvMMsgUntilStopped(efd int, fd int, msgHdrs []MMsgHdr) (int, tcpi return int(n), nil } - if e != 0 && e != unix.EWOULDBLOCK { - return 0, TranslateErrno(e) - } - stopped, e := BlockingPollUntilStopped(efd, fd, unix.POLLIN) if stopped { return -1, nil @@ -234,13 +228,5 @@ func BlockingPollUntilStopped(efd int, fd int, events int16) (bool, unix.Errno) }, } _, errno := BlockingPoll(&pevents[0], len(pevents), nil) - if errno != 0 { - return pevents[0].Revents&unix.POLLIN != 0, errno - } - - if pevents[1].Revents&unix.POLLHUP != 0 || pevents[1].Revents&unix.POLLERR != 0 { - errno = unix.ECONNRESET - } - return pevents[0].Revents&unix.POLLIN != 0, errno } |