wpa_supplicant: Use PF_LOCAL instead of PF_INET*

Using a local socket circumvents the issue of needing any Internet
protocol (PF_INET or PF_INET6) support.
We only use interface ("i" group) ioctls on this socket so we can get
away with using PF_LOCAL instead of requring any Internet protocol
(PF_INET or PF_INET6) support on the system. This simplifies the
patch from 8c7149c73f.

PR:				286259
Noted by:			kevans
Fixes:				8c7149c73f
MFC after:			2 weeks
Reviewed by:			kevans, philip,
				zarychtam_plan-b.pwste.edu.pl (mzar)
Differential revision:		https://reviews.freebsd.org/D50050
This commit is contained in:
Cy Schubert 2025-04-27 18:16:37 -07:00
parent 4e2616b74c
commit 6aeec6a741

View file

@ -1798,21 +1798,11 @@ bsd_global_init(void *ctx)
global->ctx = ctx;
dl_list_init(&global->ifaces);
global->sock = socket(PF_INET, SOCK_DGRAM | SOCK_CLOEXEC, 0);
global->sock = socket(PF_LOCAL, 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",
wpa_printf(MSG_ERROR, "socket[PF_LOCAL,SOCK_DGRAM]: %s",
strerror(errno));
goto fail1;
}
}
global->route = socket(PF_ROUTE,