git: edaddcd1a5bb - main - security/wpa_supplicant: Add option to build libwpa_client

From: Robert Clausecker <fuz_at_FreeBSD.org>
Date: Tue, 14 Oct 2025 14:57:13 UTC
The branch main has been updated by fuz:

URL: https://cgit.FreeBSD.org/ports/commit/?id=edaddcd1a5bb374e58de0d4f99a7cccf6aed09ec

commit edaddcd1a5bb374e58de0d4f99a7cccf6aed09ec
Author:     Muhammad Saheed <saheed@FreeBSD.org>
AuthorDate: 2025-08-19 05:33:27 +0000
Commit:     Robert Clausecker <fuz@FreeBSD.org>
CommitDate: 2025-10-14 14:56:32 +0000

    security/wpa_supplicant: Add option to build libwpa_client
    
    CONFIG_BUILD_WPA_CLIENT_SO allows building the libwpa_client shared
    library and the wpa_ctrl.h header file.  This library provides helpers
    to interact with the wpa_supplicant control interface.
    
    This is required for net/wutil.
    
    Approved by:    cy (maintainer timeout)
    PR:             288933
    Sponsored by:   Google LLC (GSoC 2025)
---
 security/wpa_supplicant/Makefile                   | 21 ++++++--
 .../wpa_supplicant/files/patch-src_common_dhcp.h   |  4 +-
 .../files/patch-src_drivers_driver__bsd.c          | 60 +++++++++++-----------
 .../files/patch-src_drivers_driver__ndis.c         | 18 +++----
 .../patch-src_l2__packet_l2__packet__freebsd.c     |  4 +-
 .../files/patch-src_utils_os__unix.c               |  9 ++--
 .../wpa_supplicant/files/patch-src_wps_wps__upnp.c |  6 +--
 .../files/patch-wpa__supplicant_Makefile           | 13 ++++-
 .../patch-wpa__supplicant_ctrl__iface__unix.c      |  8 +--
 .../files/patch-wpa__supplicant_main.c             | 12 ++---
 .../files/patch-wpa__supplicant_wpa__supplicant.c  |  6 +--
 11 files changed, 93 insertions(+), 68 deletions(-)

diff --git a/security/wpa_supplicant/Makefile b/security/wpa_supplicant/Makefile
index a40c862c2b61..adb1a5c98e70 100644
--- a/security/wpa_supplicant/Makefile
+++ b/security/wpa_supplicant/Makefile
@@ -1,6 +1,6 @@
 PORTNAME=	wpa_supplicant
 PORTVERSION=	2.11
-PORTREVISION=	5
+PORTREVISION=	6
 CATEGORIES=	security net
 MASTER_SITES=	https://w1.fi/releases/
 
@@ -12,6 +12,7 @@ LICENSE=	BSD3CLAUSE
 LICENSE_FILE=	${WRKSRC}/README
 
 USES=		cpe gmake pkgconfig:build readline ssl
+USE_LDCONFIG=	yes
 BUILD_WRKSRC=	${WRKSRC}/wpa_supplicant
 INSTALL_WRKSRC=	${WRKSRC}/src
 CFLAGS+=	${CPPFLAGS} # USES=readline only augments CPPFLAGS and LDFLAGS
@@ -39,13 +40,13 @@ OPTIONS_DEFINE=		WPS WPS_ER WPS_NOREG WPS_NFC WPS_UPNP PKCS12 SMARTCARD \
 			DELAYED_MIC IEEE80211N IEEE80211AC INTERWORKING \
 			IEEE8021X_EAPOL EAPOL_TEST \
 			HS20 NO_ROAMING P2P TDLS DBUS MATCH DOCS \
-                        SIM_SIMULATOR USIM_SIMULATOR WEP PASN
+			SIM_SIMULATOR USIM_SIMULATOR WEP PASN LIBWPA
 OPTIONS_DEFAULT=	BSD WIRED \
 			TLS PEAP TTLS MD5 MSCHAPV2 GTC LEAP OTP PSK \
 			WPS PKCS12 SMARTCARD IEEE80211R DEBUG_SYSLOG \
 			INTERWORKING HS20 DBUS MATCH IEEE80211R IEEE80211W \
 			IEEE8021X_EAPOL WPS_ER WPS_NFC WPS_UPNP \
-			FAST PWD PAX SAKE GPSK TNC IKEV2 EKE WEP PASN
+			FAST PWD PAX SAKE GPSK TNC IKEV2 EKE WEP PASN LIBWPA
 OPTIONS_SUB=
 
 WPS_DESC=		Wi-Fi Protected Setup
@@ -108,10 +109,14 @@ SAKE_DESC=		Shared-Secret Authentication & Key Establishment
 GPSK_DESC=		Generalized Pre-Shared Key
 TNC_DESC=		Trusted Network Connect
 PASN_DESC=		Pre-Association Security Negotiation
+LIBWPA_DESC=	libwpa_client Shared Library
 
 PRIVSEP_PLIST_FILES=	sbin/wpa_priv
 DBUS_PLIST_FILES=	share/dbus-1/system-services/fi.w1.wpa_supplicant1.service \
 			etc/dbus-1/system.d/dbus-wpa_supplicant.conf
+LIBWPA_PLIST_FILES=	lib/libwpa_client.so \
+			lib/libwpa_client.so.2 \
+			include/wpa_ctrl.h
 
 .include <bsd.port.pre.mk>
 
@@ -189,6 +194,9 @@ post-patch:
 .endif
 .if ${PORT_OPTIONS:MSIM_SIMULATOR}
 	@${ECHO_CMD} CONFIG_SIM_SIMULATOR=y >> ${CFG}
+.endif
+.if ${PORT_OPTIONS:MLIBWPA}
+	@${ECHO_CMD} CONFIG_BUILD_WPA_CLIENT_SO=y >> ${CFG}
 .endif
 	@${ECHO_CMD} CONFIG_OS=unix >> ${CFG}
 	@${ECHO_CMD} CONFIG_CTRL_IFACE=unix >> ${CFG}
@@ -224,4 +232,11 @@ do-install-DBUS-on:
 	${INSTALL_DATA} ${BUILD_WRKSRC}/dbus/dbus-wpa_supplicant.conf \
 		${STAGEDIR}${PREFIX}/etc/dbus-1/system.d/
 
+do-install-LIBWPA-on:
+	${INSTALL_LIB} ${BUILD_WRKSRC}/libwpa_client.so \
+		${STAGEDIR}${PREFIX}/lib/libwpa_client.so.2
+	${LN} -s libwpa_client.so.2 ${STAGEDIR}${PREFIX}/lib/libwpa_client.so
+	${INSTALL_DATA} ${INSTALL_WRKSRC}/common/wpa_ctrl.h \
+		${STAGEDIR}${PREFIX}/include
+
 .include <bsd.port.post.mk>
diff --git a/security/wpa_supplicant/files/patch-src_common_dhcp.h b/security/wpa_supplicant/files/patch-src_common_dhcp.h
index f88d1921a380..d25233a070b7 100644
--- a/security/wpa_supplicant/files/patch-src_common_dhcp.h
+++ b/security/wpa_supplicant/files/patch-src_common_dhcp.h
@@ -1,5 +1,5 @@
---- src/common/dhcp.h.orig	2018-12-02 11:34:59.000000000 -0800
-+++ src/common/dhcp.h	2018-12-06 00:01:11.429254000 -0800
+--- src/common/dhcp.h.orig	2024-07-20 18:04:37 UTC
++++ src/common/dhcp.h
 @@ -9,6 +9,22 @@
  #ifndef DHCP_H
  #define DHCP_H
diff --git a/security/wpa_supplicant/files/patch-src_drivers_driver__bsd.c b/security/wpa_supplicant/files/patch-src_drivers_driver__bsd.c
index 7c22ee2a372c..6e83ddc25b46 100644
--- a/security/wpa_supplicant/files/patch-src_drivers_driver__bsd.c
+++ b/security/wpa_supplicant/files/patch-src_drivers_driver__bsd.c
@@ -1,5 +1,5 @@
---- src/drivers/driver_bsd.c.orig	2024-07-20 11:04:37.000000000 -0700
-+++ src/drivers/driver_bsd.c	2025-04-07 12:47:28.984390000 -0700
+--- src/drivers/driver_bsd.c.orig	2024-07-20 18:04:37 UTC
++++ src/drivers/driver_bsd.c
 @@ -9,11 +9,13 @@
  
  #include "includes.h"
@@ -14,7 +14,7 @@
  #include "common/wpa_common.h"
  
  #include <ifaddrs.h>
-@@ -293,8 +295,9 @@
+@@ -293,8 +295,9 @@ static int
  }
  
  static int
@@ -25,7 +25,7 @@
  	struct ifreq ifr;
  
  	os_memset(&ifr, 0, sizeof(ifr));
-@@ -306,7 +309,34 @@
+@@ -306,7 +309,34 @@ bsd_get_iface_flags(struct bsd_driver_data *drv)
  		return -1;
  	}
  	drv->flags = ifr.ifr_flags;
@@ -60,7 +60,7 @@
  }
  
  static int
-@@ -349,6 +379,20 @@
+@@ -349,6 +379,20 @@ bsd_set_key(void *priv, struct wpa_driver_set_key_para
  	case WPA_ALG_CCMP:
  		wk.ik_type = IEEE80211_CIPHER_AES_CCM;
  		break;
@@ -81,7 +81,7 @@
  	default:
  		wpa_printf(MSG_ERROR, "%s: unknown alg=%d", __func__, alg);
  		return -1;
-@@ -413,13 +457,34 @@
+@@ -413,13 +457,34 @@ bsd_configure_wpa(void *priv, struct wpa_bss_params *p
  {
  #ifndef IEEE80211_IOC_APPIE
  	static const char *ciphernames[] =
@@ -116,7 +116,7 @@
  	case WPA_CIPHER_TKIP:
  		v = IEEE80211_CIPHER_TKIP;
  		break;
-@@ -456,8 +521,18 @@
+@@ -456,8 +521,18 @@ bsd_configure_wpa(void *priv, struct wpa_bss_params *p
  	}
  
  	v = 0;
@@ -135,7 +135,7 @@
  	if (params->wpa_pairwise & WPA_CIPHER_TKIP)
  		v |= 1<<IEEE80211_CIPHER_TKIP;
  	if (params->wpa_pairwise & WPA_CIPHER_NONE)
-@@ -525,7 +600,7 @@
+@@ -525,7 +600,7 @@ bsd_set_ieee8021x(void *priv, struct wpa_bss_params *p
  			   __func__);
  		return -1;
  	}
@@ -144,7 +144,7 @@
  }
  
  static void
-@@ -586,6 +661,7 @@
+@@ -586,6 +661,7 @@ bsd_set_freq(void *priv, struct hostapd_freq_params *f
  		mode = IFM_IEEE80211_11B;
  	} else {
  		mode =
@@ -152,7 +152,7 @@
  			freq->ht_enabled ? IFM_IEEE80211_11NA :
  			IFM_IEEE80211_11A;
  	}
-@@ -853,14 +929,18 @@
+@@ -853,14 +929,18 @@ bsd_wireless_event_receive(int sock, void *ctx, void *
  		drv = bsd_get_drvindex(global, ifm->ifm_index);
  		if (drv == NULL)
  			return;
@@ -174,7 +174,7 @@
  			wpa_printf(MSG_DEBUG, "RTM_IFINFO: Interface '%s' UP",
  				   drv->ifname);
  			wpa_supplicant_event(drv->ctx, EVENT_INTERFACE_ENABLED,
-@@ -1027,7 +1107,8 @@
+@@ -1027,7 +1107,8 @@ bsd_init(struct hostapd_data *hapd, struct wpa_init_pa
  	if (l2_packet_get_own_addr(drv->sock_xmit, params->own_addr))
  		goto bad;
  
@@ -184,7 +184,7 @@
  		goto bad;
  
  	if (bsd_set_mediaopt(drv, IFM_OMASK, IFM_IEEE80211_HOSTAP) < 0) {
-@@ -1052,12 +1133,13 @@
+@@ -1052,12 +1133,13 @@ bsd_deinit(void *priv)
  {
  	struct bsd_driver_data *drv = priv;
  
@@ -199,7 +199,7 @@
  static int
  bsd_set_sta_authorized(void *priv, const u8 *addr,
  		       unsigned int total_flags, unsigned int flags_or,
-@@ -1199,13 +1281,41 @@
+@@ -1199,13 +1281,41 @@ static int
  }
  
  static int
@@ -242,7 +242,7 @@
  
  	wpa_printf(MSG_DEBUG,
  		"%s: ssid '%.*s' wpa ie len %u pairwise %u group %u key mgmt %u"
-@@ -1222,7 +1332,10 @@
+@@ -1222,7 +1332,10 @@ wpa_driver_bsd_associate(void *priv, struct wpa_driver
  		mode = 0 /* STA */;
  		break;
  	case IEEE80211_MODE_IBSS:
@@ -253,7 +253,7 @@
  		break;
  	case IEEE80211_MODE_AP:
  		mode = IFM_IEEE80211_HOSTAP;
-@@ -1251,22 +1364,31 @@
+@@ -1251,24 +1364,33 @@ wpa_driver_bsd_associate(void *priv, struct wpa_driver
  		ret = -1;
  	if (wpa_driver_bsd_set_auth_alg(drv, params->auth_alg) < 0)
  		ret = -1;
@@ -266,9 +266,6 @@
 -	    params->key_mgmt_suite == WPA_KEY_MGMT_NONE &&
 -	    params->wpa_ie_len == 0);
 -	wpa_printf(MSG_DEBUG, "%s: set PRIVACY %u", __func__, privacy);
--
--	if (set80211param(drv, IEEE80211_IOC_PRIVACY, privacy) < 0)
--		return -1;
 +	if (params->wpa_ie_len) {
 +		rsn_ie = get_ie(params->wpa_ie, params->wpa_ie_len,
 +		    WLAN_EID_RSN);
@@ -288,9 +285,7 @@
 +		}
 +	}
  
--	if (params->wpa_ie_len &&
--	    set80211param(drv, IEEE80211_IOC_WPA,
--			  params->wpa_ie[0] == WLAN_EID_RSN ? 2 : 1) < 0)
+-	if (set80211param(drv, IEEE80211_IOC_PRIVACY, privacy) < 0)
 +	/*
 +	 * NB: interface must be marked UP for association
 +	 * or scanning (ap_scan=2)
@@ -298,8 +293,15 @@
 +	if (bsd_ctrl_iface(drv, 1) < 0)
  		return -1;
  
+-	if (params->wpa_ie_len &&
+-	    set80211param(drv, IEEE80211_IOC_WPA,
+-			  params->wpa_ie[0] == WLAN_EID_RSN ? 2 : 1) < 0)
+-		return -1;
+-
  	os_memset(&mlme, 0, sizeof(mlme));
-@@ -1311,11 +1433,8 @@
+ 	mlme.im_op = IEEE80211_MLME_ASSOC;
+ 	if (params->ssid != NULL)
+@@ -1311,11 +1433,8 @@ wpa_driver_bsd_scan(void *priv, struct wpa_driver_scan
  	}
  
  	/* NB: interface must be marked UP to do a scan */
@@ -312,7 +314,7 @@
  
  #ifdef IEEE80211_IOC_SCAN_MAX_SSID
  	os_memset(&sr, 0, sizeof(sr));
-@@ -1495,6 +1614,12 @@
+@@ -1495,6 +1614,12 @@ static int wpa_driver_bsd_capa(struct bsd_driver_data 
  		drv->capa.enc |= WPA_DRIVER_CAPA_ENC_TKIP;
  	if (devcaps.dc_cryptocaps & IEEE80211_CRYPTO_AES_CCM)
  		drv->capa.enc |= WPA_DRIVER_CAPA_ENC_CCMP;
@@ -325,7 +327,7 @@
  
  	if (devcaps.dc_drivercaps & IEEE80211_C_HOSTAP)
  		drv->capa.flags |= WPA_DRIVER_FLAGS_AP;
-@@ -1547,6 +1672,8 @@
+@@ -1547,6 +1672,8 @@ get80211opmode(struct bsd_driver_data *drv)
  		}
  		if (ifmr.ifm_current & IFM_IEEE80211_HOSTAP)
  			return IEEE80211_M_HOSTAP;
@@ -334,7 +336,7 @@
  		if (ifmr.ifm_current & IFM_IEEE80211_MONITOR)
  			return IEEE80211_M_MONITOR;
  #ifdef IEEE80211_M_MBSS
-@@ -1607,7 +1734,7 @@
+@@ -1607,7 +1734,7 @@ wpa_driver_bsd_init(void *ctx, const char *ifname, voi
  		drv->capa.key_mgmt_iftype[i] = drv->capa.key_mgmt;
  
  	/* Down interface during setup. */
@@ -343,13 +345,13 @@
  		goto fail;
  
  	/* Proven to work, lets go! */
-@@ -1631,6 +1758,9 @@
+@@ -1630,6 +1757,9 @@ wpa_driver_bsd_deinit(void *priv)
+ 
  	if (drv->ifindex != 0 && !drv->if_removed) {
  		wpa_driver_bsd_set_wpa(drv, 0);
- 
++
 +		/* NB: mark interface down */
 +		bsd_ctrl_iface(drv, 0);
-+
+ 
  		wpa_driver_bsd_set_wpa_internal(drv, drv->prev_wpa,
  						drv->prev_privacy);
- 
diff --git a/security/wpa_supplicant/files/patch-src_drivers_driver__ndis.c b/security/wpa_supplicant/files/patch-src_drivers_driver__ndis.c
index 5c58337c4b3d..3fa5a11bd8e2 100644
--- a/security/wpa_supplicant/files/patch-src_drivers_driver__ndis.c
+++ b/security/wpa_supplicant/files/patch-src_drivers_driver__ndis.c
@@ -1,6 +1,6 @@
---- src/drivers/driver_ndis.c.orig	2019-08-07 13:25:25 UTC
+--- src/drivers/driver_ndis.c.orig	2024-07-20 18:04:37 UTC
 +++ src/drivers/driver_ndis.c
-@@ -504,13 +504,13 @@ static int ndis_get_oid(struct wpa_drive
+@@ -504,13 +504,13 @@ static int ndis_get_oid(struct wpa_driver_ndis_data *d
  	o->Length = len;
  
  	if (!PacketRequest(drv->adapter, FALSE, o)) {
@@ -16,7 +16,7 @@
  			   __func__, oid, (unsigned int) o->Length, len);
  		os_free(buf);
  		return -1;
-@@ -573,7 +573,7 @@ static int ndis_set_oid(struct wpa_drive
+@@ -573,7 +573,7 @@ static int ndis_set_oid(struct wpa_driver_ndis_data *d
  		os_memcpy(o->Data, data, len);
  
  	if (!PacketRequest(drv->adapter, TRUE, o)) {
@@ -25,7 +25,7 @@
  			   __func__, oid, len);
  		os_free(buf);
  		return -1;
-@@ -1531,7 +1531,7 @@ static void wpa_driver_ndis_event_auth(s
+@@ -1543,7 +1543,7 @@ static void wpa_driver_ndis_event_auth(struct wpa_driv
  
  	if (data_len < sizeof(*req)) {
  		wpa_printf(MSG_DEBUG, "NDIS: Too short Authentication Request "
@@ -34,7 +34,7 @@
  		return;
  	}
  	req = (NDIS_802_11_AUTHENTICATION_REQUEST *) data;
-@@ -1565,7 +1565,7 @@ static void wpa_driver_ndis_event_pmkid(
+@@ -1577,7 +1577,7 @@ static void wpa_driver_ndis_event_pmkid(struct wpa_dri
  
  	if (data_len < 8) {
  		wpa_printf(MSG_DEBUG, "NDIS: Too short PMKID Candidate List "
@@ -43,7 +43,7 @@
  		return;
  	}
  	pmkid = (NDIS_802_11_PMKID_CANDIDATE_LIST *) data;
-@@ -1587,7 +1587,7 @@ static void wpa_driver_ndis_event_pmkid(
+@@ -1599,7 +1599,7 @@ static void wpa_driver_ndis_event_pmkid(struct wpa_dri
  	os_memset(&event, 0, sizeof(event));
  	for (i = 0; i < pmkid->NumCandidates; i++) {
  		PMKID_CANDIDATE *p = &pmkid->CandidateList[i];
@@ -52,7 +52,7 @@
  			   i, MAC2STR(p->BSSID), (int) p->Flags);
  		os_memcpy(event.pmkid_candidate.bssid, p->BSSID, ETH_ALEN);
  		event.pmkid_candidate.index = i;
-@@ -1778,7 +1778,7 @@ static void wpa_driver_ndis_get_capabili
+@@ -1790,7 +1790,7 @@ static void wpa_driver_ndis_get_capability(struct wpa_
  				   "overflow");
  			break;
  		}
@@ -61,7 +61,7 @@
  			   i, (int) ae->AuthModeSupported,
  			   (int) ae->EncryptStatusSupported);
  		switch (ae->AuthModeSupported) {
-@@ -2106,7 +2106,11 @@ static int wpa_driver_ndis_get_names(str
+@@ -2118,7 +2118,11 @@ static int wpa_driver_ndis_get_names(struct wpa_driver
  		dlen = dpos - desc;
  	else
  		dlen = os_strlen(desc);
@@ -74,7 +74,7 @@
  	os_free(b);
  	if (drv->adapter_desc == NULL)
  		return -1;
-@@ -2274,7 +2278,11 @@ static int wpa_driver_ndis_get_names(str
+@@ -2286,7 +2290,11 @@ static int wpa_driver_ndis_get_names(struct wpa_driver
  	} else {
  		dlen = os_strlen(desc[i]);
  	}
diff --git a/security/wpa_supplicant/files/patch-src_l2__packet_l2__packet__freebsd.c b/security/wpa_supplicant/files/patch-src_l2__packet_l2__packet__freebsd.c
index 2ec52fcdcd85..cd0c9a56f055 100644
--- a/security/wpa_supplicant/files/patch-src_l2__packet_l2__packet__freebsd.c
+++ b/security/wpa_supplicant/files/patch-src_l2__packet_l2__packet__freebsd.c
@@ -1,5 +1,5 @@
---- src/l2_packet/l2_packet_freebsd.c.orig	2023-10-30 10:53:18.000000000 -0700
-+++ src/l2_packet/l2_packet_freebsd.c	2023-10-30 14:10:36.396969000 -0700
+--- src/l2_packet/l2_packet_freebsd.c.orig	2024-07-20 18:04:37 UTC
++++ src/l2_packet/l2_packet_freebsd.c
 @@ -8,7 +8,10 @@
   */
  
diff --git a/security/wpa_supplicant/files/patch-src_utils_os__unix.c b/security/wpa_supplicant/files/patch-src_utils_os__unix.c
index d3ebadbba827..3feccd7f0b28 100644
--- a/security/wpa_supplicant/files/patch-src_utils_os__unix.c
+++ b/security/wpa_supplicant/files/patch-src_utils_os__unix.c
@@ -1,6 +1,6 @@
---- src/utils/os_unix.c.orig	2024-05-10 09:57:55.000000000 -0700
-+++ src/utils/os_unix.c	2024-06-01 22:18:54.999484000 -0700
-@@ -103,10 +103,12 @@
+--- src/utils/os_unix.c.orig	2024-07-20 18:04:37 UTC
++++ src/utils/os_unix.c
+@@ -103,9 +103,11 @@ int os_get_reltime(struct os_reltime *t)
  			break;
  #endif
  #ifdef CLOCK_MONOTONIC
@@ -8,8 +8,7 @@
  		case CLOCK_MONOTONIC:
  			clock_id = CLOCK_REALTIME;
  			break;
- #endif
 +#endif
+ #endif
  		case CLOCK_REALTIME:
  			return -1;
- 		}
diff --git a/security/wpa_supplicant/files/patch-src_wps_wps__upnp.c b/security/wpa_supplicant/files/patch-src_wps_wps__upnp.c
index ee10b79e48aa..2a0e56329a07 100644
--- a/security/wpa_supplicant/files/patch-src_wps_wps__upnp.c
+++ b/security/wpa_supplicant/files/patch-src_wps_wps__upnp.c
@@ -1,6 +1,6 @@
---- src/wps/wps_upnp.c.orig	2021-03-16 13:50:10.000000000 -0700
-+++ src/wps/wps_upnp.c	2021-03-18 12:49:19.537874000 -0700
-@@ -963,7 +963,8 @@
+--- src/wps/wps_upnp.c.orig	2024-07-20 18:04:37 UTC
++++ src/wps/wps_upnp.c
+@@ -963,7 +963,8 @@ int get_netif_info(const char *net_if, unsigned *ip_ad
  		goto fail;
  	}
  	os_memcpy(mac, req.ifr_addr.sa_data, 6);
diff --git a/security/wpa_supplicant/files/patch-wpa__supplicant_Makefile b/security/wpa_supplicant/files/patch-wpa__supplicant_Makefile
index 9f1393fb85da..1efb42a0844f 100644
--- a/security/wpa_supplicant/files/patch-wpa__supplicant_Makefile
+++ b/security/wpa_supplicant/files/patch-wpa__supplicant_Makefile
@@ -1,6 +1,6 @@
---- wpa_supplicant/Makefile.orig	2015-03-15 17:30:39 UTC
+--- wpa_supplicant/Makefile.orig	2024-07-20 18:04:37 UTC
 +++ wpa_supplicant/Makefile
-@@ -99,6 +99,14 @@ OBJS += ../src/utils/os_$(CONFIG_OS).o
+@@ -140,6 +140,14 @@ OBJS_c += ../src/utils/os_$(CONFIG_OS).o
  OBJS_p += ../src/utils/os_$(CONFIG_OS).o
  OBJS_c += ../src/utils/os_$(CONFIG_OS).o
  
@@ -15,3 +15,12 @@
  ifdef CONFIG_WPA_TRACE
  CFLAGS += -DWPA_TRACE
  OBJS += ../src/utils/trace.o
+@@ -2050,7 +2058,7 @@ libwpa_client.so: $(LIBCTRLSO)
+ 
+ libwpa_client.so: $(LIBCTRLSO)
+ 	@$(E) "  CC  $@ ($^)"
+-	$(Q)$(CC) $(LDFLAGS) -o $@ $(CFLAGS) -shared -fPIC $^
++	$(Q)$(CC) $(LDFLAGS) -o $@ $(CFLAGS) -Wl,-soname,$@.2 -shared -fPIC $^
+ 
+ OBJS_wpatest := libwpa_test.o
+ _OBJS_VAR := OBJS_wpatest
diff --git a/security/wpa_supplicant/files/patch-wpa__supplicant_ctrl__iface__unix.c b/security/wpa_supplicant/files/patch-wpa__supplicant_ctrl__iface__unix.c
index cc73ac35cd35..80a0c9d7cf1a 100644
--- a/security/wpa_supplicant/files/patch-wpa__supplicant_ctrl__iface__unix.c
+++ b/security/wpa_supplicant/files/patch-wpa__supplicant_ctrl__iface__unix.c
@@ -1,6 +1,6 @@
---- wpa_supplicant/ctrl_iface_unix.c.orig	2022-01-16 12:51:29.000000000 -0800
-+++ wpa_supplicant/ctrl_iface_unix.c	2023-11-29 08:12:07.843443000 -0800
-@@ -506,6 +506,10 @@
+--- wpa_supplicant/ctrl_iface_unix.c.orig	2024-07-20 18:04:37 UTC
++++ wpa_supplicant/ctrl_iface_unix.c
+@@ -509,6 +509,10 @@ static int wpas_ctrl_iface_open_sock(struct wpa_suppli
  	struct group *grp;
  	char *endp;
  	int flags;
@@ -11,7 +11,7 @@
  
  	buf = os_strdup(wpa_s->conf->ctrl_interface);
  	if (buf == NULL)
-@@ -678,6 +682,22 @@
+@@ -681,6 +685,22 @@ havesock:
  			/* Not fatal, continue on.*/
  		}
  	}
diff --git a/security/wpa_supplicant/files/patch-wpa__supplicant_main.c b/security/wpa_supplicant/files/patch-wpa__supplicant_main.c
index 3042768f44d9..f9db90635a4c 100644
--- a/security/wpa_supplicant/files/patch-wpa__supplicant_main.c
+++ b/security/wpa_supplicant/files/patch-wpa__supplicant_main.c
@@ -1,6 +1,6 @@
---- wpa_supplicant/main.c.orig	2016-11-05 20:56:30 UTC
+--- wpa_supplicant/main.c.orig	2024-07-20 18:04:37 UTC
 +++ wpa_supplicant/main.c
-@@ -66,7 +66,7 @@ static void usage(void)
+@@ -67,7 +67,7 @@ static void usage(void)
  	       "  -c = Configuration file\n"
  	       "  -C = ctrl_interface parameter (only used if -c is not)\n"
  	       "  -d = increase debugging verbosity (-dd even more)\n"
@@ -9,7 +9,7 @@
  	       "  -e = entropy file\n"
  #ifdef CONFIG_DEBUG_FILE
  	       "  -f = log output to debug file instead of stdout\n"
-@@ -105,8 +105,7 @@ static void usage(void)
+@@ -106,8 +106,7 @@ static void usage(void)
  	       "  -W = wait for a control interface monitor before starting\n");
  
  	printf("example:\n"
@@ -20,14 +20,14 @@
  }
  
 @@ -199,6 +198,11 @@ int main(int argc, char *argv[])
+ 	iface_count = 1;
  
  	wpa_supplicant_fd_workaround(1);
- 
++
 +#ifdef CONFIG_DRIVER_NDIS
 +	void driver_ndis_init_ops(void);
 +	driver_ndis_init_ops();
 +#endif /* CONFIG_DRIVER_NDIS */
-+
+ 
  	for (;;) {
  		c = getopt(argc, argv,
- 			   "b:Bc:C:D:de:f:g:G:hi:I:KLMm:No:O:p:P:qsTtuvW");
diff --git a/security/wpa_supplicant/files/patch-wpa__supplicant_wpa__supplicant.c b/security/wpa_supplicant/files/patch-wpa__supplicant_wpa__supplicant.c
index 42f150b3595c..8013244d9f7f 100644
--- a/security/wpa_supplicant/files/patch-wpa__supplicant_wpa__supplicant.c
+++ b/security/wpa_supplicant/files/patch-wpa__supplicant_wpa__supplicant.c
@@ -1,6 +1,6 @@
---- wpa_supplicant/wpa_supplicant.c.orig	2019-04-21 03:10:22.000000000 -0400
-+++ wpa_supplicant/wpa_supplicant.c	2019-05-15 22:44:44.919859000 -0400
-@@ -6357,13 +6357,6 @@
+--- wpa_supplicant/wpa_supplicant.c.orig	2024-07-20 18:04:37 UTC
++++ wpa_supplicant/wpa_supplicant.c
+@@ -7983,13 +7983,6 @@ struct wpa_global * wpa_supplicant_init(struct wpa_par
  	if (params == NULL)
  		return NULL;