From 2fcca60a7bf084a28e878941d9dcb47e11268cbd Mon Sep 17 00:00:00 2001 From: Andrei Vagin Date: Mon, 9 Nov 2020 13:55:28 -0800 Subject: net: connect to the ipv4 localhost returns ENETUNREACH if the address isn't set cl/340002915 modified the code to return EADDRNOTAVAIL if connect is called for a localhost address which isn't set. But actually, Linux returns EADDRNOTAVAIL for ipv6 addresses and ENETUNREACH for ipv4 addresses. Updates #4735 PiperOrigin-RevId: 341479129 --- test/syscalls/linux/socket_ip_unbound_netlink.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'test/syscalls/linux') diff --git a/test/syscalls/linux/socket_ip_unbound_netlink.cc b/test/syscalls/linux/socket_ip_unbound_netlink.cc index 6036bfcaf..7fb1c0faf 100644 --- a/test/syscalls/linux/socket_ip_unbound_netlink.cc +++ b/test/syscalls/linux/socket_ip_unbound_netlink.cc @@ -92,7 +92,7 @@ TEST_P(IPv4UnboundSocketTest, ConnectToBadLocalAddress_NoRandomSave) { auto sock = ASSERT_NO_ERRNO_AND_VALUE(NewSocket()); EXPECT_THAT(connect(sock->get(), reinterpret_cast(&addr.addr), addr.addr_len), - SyscallFailsWithErrno(EADDRNOTAVAIL)); + SyscallFailsWithErrno(ENETUNREACH)); } INSTANTIATE_TEST_SUITE_P(IPUnboundSockets, IPv4UnboundSocketTest, -- cgit v1.2.3