From a1601aaa66e9bf19bb8d0af7535f493f6cbe6736 Mon Sep 17 00:00:00 2001 From: Sathishkumar Muruganandam Date: Sat, 20 May 2023 12:06:07 +0530 Subject: [PATCH] WPS: Fix multi-ap fronthaul association Setting 4addr mode on fronthaul BSS breaks WPS association on backhaul STA which is still on 3addr mode. Fix the interop issue by not setting 4addr mode on fronthaul BSS with WPS instead of setting by default for multi-ap case. Fronthaul BSS for non-WPS STA shall continue to use 4addr mode. Signed-off-by: Sathishkumar Muruganandam --- src/ap/ieee802_11.c | 6 +++++- src/ap/sta_info.c | 5 ++++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/src/ap/ieee802_11.c b/src/ap/ieee802_11.c index f795c06a6..48b0219f3 100644 --- a/src/ap/ieee802_11.c +++ b/src/ap/ieee802_11.c @@ -5758,7 +5758,11 @@ static void handle_assoc_cb(struct hostapd_data *hapd, sta->flags |= WLAN_STA_WDS; } - if (sta->flags & (WLAN_STA_WDS | WLAN_STA_MULTI_AP)) { + /* WPS not supported on backhaul BSS. Disable 4addr mode on fronthaul */ + if ((sta->flags & WLAN_STA_WDS) || + (sta->flags & WLAN_STA_MULTI_AP && + !(hapd->conf->multi_ap & FRONTHAUL_BSS) && + !(sta->flags & WLAN_STA_WPS))) { int ret; char ifname_wds[IFNAMSIZ + 1]; diff --git a/src/ap/sta_info.c b/src/ap/sta_info.c index 4eb41528e..2fb6edf09 100644 --- a/src/ap/sta_info.c +++ b/src/ap/sta_info.c @@ -197,7 +197,10 @@ void ap_free_sta(struct hostapd_data *hapd, struct sta_info *sta) ap_sta_set_authorized(hapd, sta, 0); hostapd_set_sta_flags(hapd, sta); - if (sta->flags & (WLAN_STA_WDS | WLAN_STA_MULTI_AP)) + if ((sta->flags & WLAN_STA_WDS) || + (sta->flags & WLAN_STA_MULTI_AP && + !(hapd->conf->multi_ap & FRONTHAUL_BSS) && + !(sta->flags & WLAN_STA_WPS))) hostapd_set_wds_sta(hapd, NULL, sta->addr, sta->aid, 0); if (sta->ipaddr) -- 2.47.2