From 2763d1d97e66c083b46f359b4c4e0c43c87a1d6f Mon Sep 17 00:00:00 2001 From: "Allen.Ye" Date: Thu, 3 Aug 2023 20:33:55 +0800 Subject: [PATCH] hostapd: Fix AID assignment in multiple BSSID When STAs connect to transmitted BSS and nontransmitted BSS, the AP should assign the aIDs from the same pool. Use the transmitted BSS AID pool to assign AIDs when the AP enables multiple BSSID. Signed-off-by: Allen.Ye --- src/ap/ieee802_11.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/ap/ieee802_11.c b/src/ap/ieee802_11.c index d40a821fe..aa02fc624 100644 --- a/src/ap/ieee802_11.c +++ b/src/ap/ieee802_11.c @@ -3312,6 +3312,11 @@ int hostapd_get_aid(struct hostapd_data *hapd, struct sta_info *sta) { int i, j = 32, aid; + /* Transmitted and non-transmitted BSSIDs share the same AID pool, so + * use the shared storage in the transmitted BSS to find the next + * available value. */ + hapd = hostapd_mbssid_get_tx_bss(hapd); + /* get a unique AID */ if (sta->aid > 0) { wpa_printf(MSG_DEBUG, " old AID %d", sta->aid);