Skip to content

Commit

Permalink
[PATCH] mac80211: Fix SSID matching in AP selection
Browse files Browse the repository at this point in the history
The length of the SSID desired should also be compared in addition to
the memcmp of the SSIDs.

Thanks to Andrea Merello <andreamrl@tiscali.it> for finding this issue.

Signed-off-by: Michael Wu <flamingice@sourmilk.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
  • Loading branch information
Michael Wu authored and John W. Linville committed Oct 26, 2007
1 parent c9927c2 commit 4822570
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion net/mac80211/ieee80211_sta.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 4822570

Please sign in to comment.