mirror of
https://github.com/netbirdio/gvisor.git
synced 2026-05-22 17:12:49 -07:00
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
This commit is contained in:
@@ -592,8 +592,7 @@ class RawSocketICMPv6Test : public Test {
|
||||
void SetUp() override {
|
||||
SKIP_IF(!ASSERT_NO_ERRNO_AND_VALUE(HaveRawIPSocketCapability()));
|
||||
|
||||
fd_ = ASSERT_NO_ERRNO_AND_VALUE(
|
||||
Socket(AF_INET6, SOCK_RAW | SOCK_NONBLOCK, IPPROTO_ICMPV6));
|
||||
fd_ = ASSERT_NO_ERRNO_AND_VALUE(Socket(AF_INET6, SOCK_RAW, IPPROTO_ICMPV6));
|
||||
}
|
||||
|
||||
void TearDown() override {
|
||||
|
||||
Reference in New Issue
Block a user