@@ -1684,9 +1684,19 @@ bsd_global_init(void *ctx)
global->sock = socket(PF_INET, SOCK_DGRAM | SOCK_CLOEXEC, 0);
if (global->sock < 0) {
+ if (errno == EAFNOSUPPORT || errno == EPROTONOSUPPORT) {
+ 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,
Currently, wpa_supplicant fails to operate when legacy IP support is disabled (i.e., the system is built with WITHOUT_INET and the kernel is configured with nooptions INET). This patch addresses the issue by enabling wpa_supplicant to run and connect to wireless networks even in the absence of AF_INET, as long as AF_INET6 is available. Signed-off-by: Marek Zarychta <zarychtam@plan-b.pwste.edu.pl> --- src/drivers/driver_bsd.c | 10 ++++++++++ 1 file changed, 10 insertions(+)