wpa_supplicant: Handle systems without INET (legacy IP) support

Currently, wpa_supplicant fails when legacy IP support is disabled
in FreeBSD (i.e., the world built with WITHOUT_INET and nooptions
INET in the kernel config). The proposed patch allows running
wpa_supplicant and connecting to wireless networks without INET
support when INET6 is available.

Reviewed by:		cy, adrian, philip, roy_marples.name
Differential Revision:	https://reviews.freebsd.org/D49959
This commit is contained in:
Marek Zarychta
2025-04-27 17:02:04 -07:00
committed by Cy Schubert
parent a0165254bf
commit 8c7149c73f
+10
View File
@@ -1800,9 +1800,19 @@ bsd_global_init(void *ctx)
global->sock = socket(PF_INET, SOCK_DGRAM | SOCK_CLOEXEC, 0);
if (global->sock < 0) {
if (errno == EAFNOSUPPORT) {
wpa_printf(MSG_INFO, "INET not supported, trying INET6...");
global->sock = socket(PF_INET6, SOCK_DGRAM | SOCK_CLOEXEC, 0);
if (global->sock < 0) {
wpa_printf(MSG_ERROR, "socket[PF_INET6,SOCK_DGRAM]: %s",
strerror(errno));
goto fail1;
}
} else {
wpa_printf(MSG_ERROR, "socket[PF_INET,SOCK_DGRAM]: %s",
strerror(errno));
goto fail1;
}
}
global->route = socket(PF_ROUTE,