summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--pkg/tcpip/transport/raw/endpoint.go2
-rw-r--r--test/syscalls/linux/raw_socket.cc2
2 files changed, 2 insertions, 2 deletions
diff --git a/pkg/tcpip/transport/raw/endpoint.go b/pkg/tcpip/transport/raw/endpoint.go
index eee3f11c1..87c60bdab 100644
--- a/pkg/tcpip/transport/raw/endpoint.go
+++ b/pkg/tcpip/transport/raw/endpoint.go
@@ -404,7 +404,7 @@ func (*endpoint) Disconnect() *tcpip.Error {
func (e *endpoint) Connect(addr tcpip.FullAddress) *tcpip.Error {
// Raw sockets do not support connecting to a IPv4 address on a IPv6 endpoint.
if e.TransportEndpointInfo.NetProto == header.IPv6ProtocolNumber && len(addr.Addr) != header.IPv6AddressSize {
- return tcpip.ErrInvalidOptionValue
+ return tcpip.ErrAddressFamilyNotSupported
}
e.mu.Lock()
diff --git a/test/syscalls/linux/raw_socket.cc b/test/syscalls/linux/raw_socket.cc
index c108c45df..955bcee4b 100644
--- a/test/syscalls/linux/raw_socket.cc
+++ b/test/syscalls/linux/raw_socket.cc
@@ -894,7 +894,7 @@ TEST_P(RawSocketTest, ConnectOnIPv6Socket) {
ASSERT_THAT(connect(sock, reinterpret_cast<struct sockaddr*>(&addr),
sizeof(sockaddr_in6)),
- SyscallFailsWithErrno(EINVAL));
+ SyscallFailsWithErrno(EAFNOSUPPORT));
}
INSTANTIATE_TEST_SUITE_P(