diff options
-rw-r--r-- | net/mac80211/mlme.c | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/net/mac80211/mlme.c b/net/mac80211/mlme.c index 6b75cb6c6300..c0a5345c8a61 100644 --- a/net/mac80211/mlme.c +++ b/net/mac80211/mlme.c | |||
@@ -2709,7 +2709,26 @@ static void ieee80211_rx_bss_info(struct net_device *dev, | |||
2709 | bss->wmm_ie_len = elems.wmm_param_len + 2; | 2709 | bss->wmm_ie_len = elems.wmm_param_len + 2; |
2710 | } else | 2710 | } else |
2711 | bss->wmm_ie_len = 0; | 2711 | bss->wmm_ie_len = 0; |
2712 | } else if (!elems.wmm_param && bss->wmm_ie) { | 2712 | } else if (elems.wmm_info && |
2713 | (!bss->wmm_ie || bss->wmm_ie_len != elems.wmm_info_len || | ||
2714 | memcmp(bss->wmm_ie, elems.wmm_info, elems.wmm_info_len))) { | ||
2715 | /* As for certain AP's Fifth bit is not set in WMM IE in | ||
2716 | * beacon frames.So while parsing the beacon frame the | ||
2717 | * wmm_info structure is used instead of wmm_param. | ||
2718 | * wmm_info structure was never used to set bss->wmm_ie. | ||
2719 | * This code fixes this problem by copying the WME | ||
2720 | * information from wmm_info to bss->wmm_ie and enabling | ||
2721 | * n-band association. | ||
2722 | */ | ||
2723 | kfree(bss->wmm_ie); | ||
2724 | bss->wmm_ie = kmalloc(elems.wmm_info_len + 2, GFP_ATOMIC); | ||
2725 | if (bss->wmm_ie) { | ||
2726 | memcpy(bss->wmm_ie, elems.wmm_info - 2, | ||
2727 | elems.wmm_info_len + 2); | ||
2728 | bss->wmm_ie_len = elems.wmm_info_len + 2; | ||
2729 | } else | ||
2730 | bss->wmm_ie_len = 0; | ||
2731 | } else if (!elems.wmm_param && !elems.wmm_info && bss->wmm_ie) { | ||
2713 | kfree(bss->wmm_ie); | 2732 | kfree(bss->wmm_ie); |
2714 | bss->wmm_ie = NULL; | 2733 | bss->wmm_ie = NULL; |
2715 | bss->wmm_ie_len = 0; | 2734 | bss->wmm_ie_len = 0; |