git: b3e677d58b7a - stable/13 - wpa_supplicant: Handle systems without INET (legacy IP) support
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Sun, 11 May 2025 04:50:15 UTC
The branch stable/13 has been updated by cy:
URL: https://cgit.FreeBSD.org/src/commit/?id=b3e677d58b7a3247d213456e05389586da82195e
commit b3e677d58b7a3247d213456e05389586da82195e
Author: Marek Zarychta <zarychtam@plan-b.pwste.edu.pl>
AuthorDate: 2025-04-28 00:02:04 +0000
Commit: Cy Schubert <cy@FreeBSD.org>
CommitDate: 2025-05-11 04:49:59 +0000
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
(cherry picked from commit 8c7149c73f8f2301369f271c98470b72973b0c01)
---
contrib/wpa/src/drivers/driver_bsd.c | 10 ++++++++++
1 file changed, 10 insertions(+)
diff --git a/contrib/wpa/src/drivers/driver_bsd.c b/contrib/wpa/src/drivers/driver_bsd.c
index 5f734b737184..e5ff319637c0 100644
--- a/contrib/wpa/src/drivers/driver_bsd.c
+++ b/contrib/wpa/src/drivers/driver_bsd.c
@@ -1769,9 +1769,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,