Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 11 May 2025 04:49:51 GMT
From:      Cy Schubert <cy@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org
Subject:   git: 70068b3030f9 - stable/14 - wpa_supplicant: Use PF_LOCAL instead of PF_INET*
Message-ID:  <202505110449.54B4npBI083184@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch stable/14 has been updated by cy:

URL: https://cgit.FreeBSD.org/src/commit/?id=70068b3030f95b3f83dd04515d58db2c7b2ad587

commit 70068b3030f95b3f83dd04515d58db2c7b2ad587
Author:     Cy Schubert <cy@FreeBSD.org>
AuthorDate: 2025-04-28 01:16:37 +0000
Commit:     Cy Schubert <cy@FreeBSD.org>
CommitDate: 2025-05-11 04:48:49 +0000

    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 8c7149c73f8f.
    
    PR:                             286259
    Noted by:                       kevans
    Fixes:                          8c7149c73f8f
    Reviewed by:                    kevans, philip,
                                    zarychtam_plan-b.pwste.edu.pl (mzar)
    Differential revision:          https://reviews.freebsd.org/D50050
    
    (cherry picked from commit 6aeec6a741975143f53feabceb1726d5033aafd6)
---
 contrib/wpa/src/drivers/driver_bsd.c | 14 ++------------
 1 file changed, 2 insertions(+), 12 deletions(-)

diff --git a/contrib/wpa/src/drivers/driver_bsd.c b/contrib/wpa/src/drivers/driver_bsd.c
index 384c0a19cfe3..26d2f3e8a231 100644
--- a/contrib/wpa/src/drivers/driver_bsd.c
+++ b/contrib/wpa/src/drivers/driver_bsd.c
@@ -1768,21 +1768,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,



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202505110449.54B4npBI083184>