Skip to content

Commit 04369e0

Browse files
Jeff-A-Martingvisor-bot
authored andcommitted
Use blocking sockets when testing raw IP sockets
The original code instantiated the raw IP sockets with NON_BLOCKING, which caused problems in the PingSuccessfully test case. That case sends and expects to immediately receive an ICMPv6 Echo Request/Reply. On Fuchsia, the Loopback devices tx/rx queues are decoupled, so it's possible for the test to call `recvmsg` before the packet has been delivered to the socket (resulting in EAGAIN). By using a blocking socket, the test will wait until `recvmsg` no longer returns EAGAIN. PiperOrigin-RevId: 641989486
1 parent 2a0dff2 commit 04369e0

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

test/syscalls/linux/raw_socket_icmp.cc

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -592,8 +592,7 @@ class RawSocketICMPv6Test : public Test {
592592
void SetUp() override {
593593
SKIP_IF(!ASSERT_NO_ERRNO_AND_VALUE(HaveRawIPSocketCapability()));
594594

595-
fd_ = ASSERT_NO_ERRNO_AND_VALUE(
596-
Socket(AF_INET6, SOCK_RAW | SOCK_NONBLOCK, IPPROTO_ICMPV6));
595+
fd_ = ASSERT_NO_ERRNO_AND_VALUE(Socket(AF_INET6, SOCK_RAW, IPPROTO_ICMPV6));
597596
}
598597

599598
void TearDown() override {

0 commit comments

Comments
 (0)