From: Michael Wu Date: Fri, 19 Oct 2007 21:14:36 +0000 (-0400) Subject: [PATCH] mac80211: Fix SSID matching in AP selection X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=48225709bec68c2d8612718922f974f22214a308;p=GitHub%2Fexynos8895%2Fandroid_kernel_samsung_universal8895.git [PATCH] 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 for finding this issue. Signed-off-by: Michael Wu Signed-off-by: John W. Linville --- diff --git a/net/mac80211/ieee80211_sta.c b/net/mac80211/ieee80211_sta.c index f7ffeec3913f..77ef223a9431 100644 --- a/net/mac80211/ieee80211_sta.c +++ b/net/mac80211/ieee80211_sta.c @@ -2096,7 +2096,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)