diff options
| -rw-r--r-- | executor/common_linux.h | 3 | ||||
| -rw-r--r-- | pkg/csource/generated.go | 2 |
2 files changed, 3 insertions, 2 deletions
diff --git a/executor/common_linux.h b/executor/common_linux.h index f53a0e781..93ecef654 100644 --- a/executor/common_linux.h +++ b/executor/common_linux.h @@ -1749,8 +1749,9 @@ static int read_tun(char* data, int size) int rv = read(tunfd, data, size); if (rv < 0) { + // EBADF can be returned if the test closes tunfd with close_range syscall. // Tun sometimes returns EBADFD, unclear if it's a kernel bug or not. - if (errno == EAGAIN || errno == EBADFD) + if (errno == EAGAIN || errno == EBADF || errno == EBADFD) return -1; fail("tun read failed"); } diff --git a/pkg/csource/generated.go b/pkg/csource/generated.go index 6f5cf9095..c983873c8 100644 --- a/pkg/csource/generated.go +++ b/pkg/csource/generated.go @@ -4258,7 +4258,7 @@ static int read_tun(char* data, int size) int rv = read(tunfd, data, size); if (rv < 0) { - if (errno == EAGAIN || errno == EBADFD) + if (errno == EAGAIN || errno == EBADF || errno == EBADFD) return -1; fail("tun read failed"); } |
