From: Johannes Berg Date: Wed, 9 Apr 2014 20:36:50 +0000 (+0200) Subject: cfg80211: ignore invalid BSSIDs when looking for BSSes X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=c14a74007f3712413140b5d06d4f7691234a8d3b;p=GitHub%2Fexynos8895%2Fandroid_kernel_samsung_universal8895.git cfg80211: ignore invalid BSSIDs when looking for BSSes When looking for a BSS matching given parameters, ignore invalid BSSIDs. This avoids, for example, trying to join an IBSS that has a multicast BSSID, which isn't supported by all drivers nor is it a valid configuration of the IBSS so better create a new one with a correctly chosen random BSSID. Signed-off-by: Johannes Berg --- diff --git a/net/wireless/scan.c b/net/wireless/scan.c index 13f611469e6c..cf478c075ddc 100644 --- a/net/wireless/scan.c +++ b/net/wireless/scan.c @@ -540,6 +540,8 @@ struct cfg80211_bss *cfg80211_get_bss(struct wiphy *wiphy, continue; if (channel && bss->pub.channel != channel) continue; + if (!is_valid_ether_addr(bss->pub.bssid)) + continue; /* Don't get expired BSS structs */ if (time_after(now, bss->ts + IEEE80211_SCAN_RESULT_EXPIRE) && !atomic_read(&bss->hold))