Skip to content

Commit 738c0bb

Browse files
committed
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 8c7149c. PR: 286259 Noted by: kevans Fixes: 8c7149c Reviewed by: kevans, philip, zarychtam_plan-b.pwste.edu.pl (mzar) Differential revision: https://reviews.freebsd.org/D50050 (cherry picked from commit 6aeec6a)
1 parent b3e677d commit 738c0bb

File tree

1 file changed

+2
-12
lines changed

1 file changed

+2
-12
lines changed

contrib/wpa/src/drivers/driver_bsd.c

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1767,21 +1767,11 @@ bsd_global_init(void *ctx)
17671767
global->ctx = ctx;
17681768
dl_list_init(&global->ifaces);
17691769

1770-
global->sock = socket(PF_INET, SOCK_DGRAM | SOCK_CLOEXEC, 0);
1770+
global->sock = socket(PF_LOCAL, SOCK_DGRAM | SOCK_CLOEXEC, 0);
17711771
if (global->sock < 0) {
1772-
if (errno == EAFNOSUPPORT) {
1773-
wpa_printf(MSG_INFO, "INET not supported, trying INET6...");
1774-
global->sock = socket(PF_INET6, SOCK_DGRAM | SOCK_CLOEXEC, 0);
1775-
if (global->sock < 0) {
1776-
wpa_printf(MSG_ERROR, "socket[PF_INET6,SOCK_DGRAM]: %s",
1777-
strerror(errno));
1778-
goto fail1;
1779-
}
1780-
} else {
1781-
wpa_printf(MSG_ERROR, "socket[PF_INET,SOCK_DGRAM]: %s",
1772+
wpa_printf(MSG_ERROR, "socket[PF_LOCAL,SOCK_DGRAM]: %s",
17821773
strerror(errno));
17831774
goto fail1;
1784-
}
17851775
}
17861776

17871777
global->route = socket(PF_ROUTE,

0 commit comments

Comments
 (0)