[PATCH] wpa_supplicant: Honor 4addr mode configuration in set_4addr_mode()

Baligh Gasmi gasmibal at gmail.com
Sun Apr 12 06:38:11 PDT 2026


Move the 4addr mode enablement check into wpa_supplicant_set_4addr_mode()
to ensure the configuration is always respected. This encapsulates the
configuration logic within the function and prevents unintended 4addr
mode activation when the feature is disabled in the network configuration.

Signed-off-by: Baligh Gasmi <gasmibal at gmail.com>
---
 wpa_supplicant/events.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/wpa_supplicant/events.c b/wpa_supplicant/events.c
index 8530d4599..a93f70b79 100644
--- a/wpa_supplicant/events.c
+++ b/wpa_supplicant/events.c
@@ -3118,6 +3118,11 @@ static void interworking_process_assoc_resp(struct wpa_supplicant *wpa_s,
 
 static void wpa_supplicant_set_4addr_mode(struct wpa_supplicant *wpa_s)
 {
+	if (wpa_s->current_ssid && !wpa_s->current_ssid->enable_4addr_mode) {
+		wpa_printf(MSG_DEBUG, "4addr mode not enabled in config");
+		return;
+	}
+
 	if (wpa_s->enabled_4addr_mode) {
 		wpa_printf(MSG_DEBUG, "4addr mode already set");
 		return;
@@ -4979,8 +4984,7 @@ static void wpa_supplicant_event_assoc(struct wpa_supplicant *wpa_s,
 	wpa_s->dpp_pfs_fallback = 0;
 #endif /* CONFIG_DPP2 */
 
-	if (wpa_s->current_ssid && wpa_s->current_ssid->enable_4addr_mode)
-		wpa_supplicant_set_4addr_mode(wpa_s);
+	wpa_supplicant_set_4addr_mode(wpa_s);
 }
 
 
-- 
2.51.0




More information about the Hostap mailing list