diff --git a/net/wireless/sme.c b/net/wireless/sme.c index 72222f0..61d3835 100644 --- a/net/wireless/sme.c +++ b/net/wireless/sme.c @@ -397,6 +397,38 @@ void cfg80211_sme_failed_assoc(struct wireless_dev *wdev) schedule_work(&rdev->conn_work); } +#define BSS_BLACKLIST(str, x, y, z) { .name = str, .bssid = { x, y, z }, } +static const struct bss_blacklist { + const char *name; + u8 bssid[3]; +} broken_country_ie_blacklist[] = { + BSS_BLACKLIST("Apple Airport Extreme", 0x00, 0x25, 0xBC), +}; +#undef BSS_BLACKLIST + +/* Kyle's Airport Extreme is a piece of crap (a pretty one, albeit.) */ +static int cfg80211_blacklist_broken_country_ie(struct cfg80211_bss *bss) +{ + int i; + + if (!bss) + return 0; + + for (i = 0; i < ARRAY_SIZE(broken_country_ie_blacklist); i++) { + const struct bss_blacklist *ent = + &broken_country_ie_blacklist[i]; + + if (bss->bssid[0] == ent->bssid[0] && + bss->bssid[1] == ent->bssid[1] && + bss->bssid[2] == ent->bssid[2]) { + printk(KERN_INFO "cfg80211: blacklisted %s country IE\n", ent->name); + return 1; + } + } + + return 0; +} + void __cfg80211_connect_result(struct net_device *dev, const u8 *bssid, const u8 *req_ie, size_t req_ie_len, const u8 *resp_ie, size_t resp_ie_len, @@ -483,6 +515,9 @@ void __cfg80211_connect_result(struct net_device *dev, const u8 *bssid, wdev->sme_state = CFG80211_SME_CONNECTED; cfg80211_upload_connect_keys(wdev); + if (cfg80211_blacklist_broken_country_ie(bss)) + return; + country_ie = (u8 *) ieee80211_bss_get_ie(bss, WLAN_EID_COUNTRY); if (!country_ie)