mirror of
https://github.com/netbirdio/gvisor.git
synced 2026-05-22 17:12:49 -07:00
Test to check setting IPV6_V6ONLY on datagram socket with IPV4 address fails.
PiperOrigin-RevId: 546955039
This commit is contained in:
committed by
gVisor bot
parent
a76207d81b
commit
1c287f3c68
@@ -2544,5 +2544,12 @@ TEST_F(SocketInetLoopbackTest, LoopbackAddressRangeConnect) {
|
||||
}
|
||||
}
|
||||
|
||||
TEST_P(SocketInetLoopbackTest, UdpIPV6Only) {
|
||||
TestAddress const& listener = V4Any();
|
||||
auto fd = ASSERT_NO_ERRNO_AND_VALUE(Socket(listener.family(), SOCK_DGRAM, 0));
|
||||
EXPECT_THAT(setsockopt(fd.get(), IPPROTO_IPV6, IPV6_V6ONLY, &kSockOptOn,
|
||||
sizeof(kSockOptOn)),
|
||||
SyscallFailsWithErrno(ENOPROTOOPT));
|
||||
}
|
||||
} // namespace testing
|
||||
} // namespace gvisor
|
||||
|
||||
Reference in New Issue
Block a user