mac80211: Fix SSID matching in AP selection
PATCH 1/1 mac80211: Fix SSID matching in AP selection
The length of the SSID desired should also be compared in addition to the memcmp of the SSIDs.
Thanks to Andrea Merello <[email protected]> for finding this issue.
Signed-off-by Michael Wu <[email protected]>
---
This should also go to stable.
net/mac80211/ieee80211_sta.c | 3 ++- 1 files changed, 2 insertions(+), 1 deletions(-)
net/mac80211/ieee80211_sta.c +2 -1
@@ -2098,7 +2098,8 @@ static int ieee80211_sta_match_ssid(struct ieee80211_if_sta *ifsta, {int tmp, hidden_ssid; -if (!memcmp (ifsta->ssid, ssid, ssid_len)) +if (ssid_len == ifsta->ssid_len && + !memcmp (ifsta->ssid, ssid, ssid_len))return 1 ;if (ifsta->flags &IEEE80211_STA_AUTO_BSSID_SEL )