Check for ENODEV for hosts with IPv6 disabled while running in IPv6 mode

This commit is contained in:
Alam Ed Arias 2025-02-01 11:00:44 -05:00
parent a203f4e553
commit 4596f20b71

View file

@ -836,6 +836,12 @@ static SOCKET_TYPE UDP_Bind(int family, struct sockaddr *addr, socklen_t addrlen
{
e = errno;
CONS_Alert(CONS_WARNING, M_GetText("Could not register multicast address\n"));
if (e == ENODEV)
{
close(s);
I_OutputMsg("Binding failed: no IPv6 device\n");
return (SOCKET_TYPE)ERRSOCKET;
}
I_OutputMsg("setting IPV6_JOIN_GROUP failed: #%u, %s \n", e, strerror(e));
}
}