Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

Merge branch 'for-john' of git://git.kernel.org/pub/scm/linux/kernel/git/jberg/mac80211

+35 -24
+1
include/net/cfg80211.h
··· 1218 1218 const u8 *ie; 1219 1219 size_t ie_len; 1220 1220 u16 reason_code; 1221 + bool local_state_change; 1221 1222 }; 1222 1223 1223 1224 /**
+23 -12
net/mac80211/mlme.c
··· 3099 3099 ht_cfreq, ht_oper->primary_chan, 3100 3100 cbss->channel->band); 3101 3101 ht_oper = NULL; 3102 + } else { 3103 + channel_type = NL80211_CHAN_HT20; 3102 3104 } 3103 3105 } 3104 3106 3105 - if (ht_oper) { 3106 - channel_type = NL80211_CHAN_HT20; 3107 + if (ht_oper && sband->ht_cap.cap & IEEE80211_HT_CAP_SUP_WIDTH_20_40) { 3108 + /* 3109 + * cfg80211 already verified that the channel itself can 3110 + * be used, but it didn't check that we can do the right 3111 + * HT type, so do that here as well. If HT40 isn't allowed 3112 + * on this channel, disable 40 MHz operation. 3113 + */ 3107 3114 3108 - if (sband->ht_cap.cap & IEEE80211_HT_CAP_SUP_WIDTH_20_40) { 3109 - switch (ht_oper->ht_param & 3110 - IEEE80211_HT_PARAM_CHA_SEC_OFFSET) { 3111 - case IEEE80211_HT_PARAM_CHA_SEC_ABOVE: 3115 + switch (ht_oper->ht_param & IEEE80211_HT_PARAM_CHA_SEC_OFFSET) { 3116 + case IEEE80211_HT_PARAM_CHA_SEC_ABOVE: 3117 + if (cbss->channel->flags & IEEE80211_CHAN_NO_HT40PLUS) 3118 + ifmgd->flags |= IEEE80211_STA_DISABLE_40MHZ; 3119 + else 3112 3120 channel_type = NL80211_CHAN_HT40PLUS; 3113 - break; 3114 - case IEEE80211_HT_PARAM_CHA_SEC_BELOW: 3121 + break; 3122 + case IEEE80211_HT_PARAM_CHA_SEC_BELOW: 3123 + if (cbss->channel->flags & IEEE80211_CHAN_NO_HT40MINUS) 3124 + ifmgd->flags |= IEEE80211_STA_DISABLE_40MHZ; 3125 + else 3115 3126 channel_type = NL80211_CHAN_HT40MINUS; 3116 - break; 3117 - } 3127 + break; 3118 3128 } 3119 3129 } 3120 3130 ··· 3559 3549 { 3560 3550 struct ieee80211_if_managed *ifmgd = &sdata->u.mgd; 3561 3551 u8 frame_buf[IEEE80211_DEAUTH_FRAME_LEN]; 3552 + bool tx = !req->local_state_change; 3562 3553 3563 3554 mutex_lock(&ifmgd->mtx); 3564 3555 ··· 3576 3565 if (ifmgd->associated && 3577 3566 ether_addr_equal(ifmgd->associated->bssid, req->bssid)) { 3578 3567 ieee80211_set_disassoc(sdata, IEEE80211_STYPE_DEAUTH, 3579 - req->reason_code, true, frame_buf); 3568 + req->reason_code, tx, frame_buf); 3580 3569 } else { 3581 3570 drv_mgd_prepare_tx(sdata->local, sdata); 3582 3571 ieee80211_send_deauth_disassoc(sdata, req->bssid, 3583 3572 IEEE80211_STYPE_DEAUTH, 3584 - req->reason_code, true, 3573 + req->reason_code, tx, 3585 3574 frame_buf); 3586 3575 } 3587 3576
+8 -3
net/mac80211/wpa.c
··· 546 546 547 547 static void bip_aad(struct sk_buff *skb, u8 *aad) 548 548 { 549 + __le16 mask_fc; 550 + struct ieee80211_hdr *hdr = (struct ieee80211_hdr *) skb->data; 551 + 549 552 /* BIP AAD: FC(masked) || A1 || A2 || A3 */ 550 553 551 554 /* FC type/subtype */ 552 - aad[0] = skb->data[0]; 553 555 /* Mask FC Retry, PwrMgt, MoreData flags to zero */ 554 - aad[1] = skb->data[1] & ~(BIT(4) | BIT(5) | BIT(6)); 556 + mask_fc = hdr->frame_control; 557 + mask_fc &= ~cpu_to_le16(IEEE80211_FCTL_RETRY | IEEE80211_FCTL_PM | 558 + IEEE80211_FCTL_MOREDATA); 559 + put_unaligned(mask_fc, (__le16 *) &aad[0]); 555 560 /* A1 || A2 || A3 */ 556 - memcpy(aad + 2, skb->data + 4, 3 * ETH_ALEN); 561 + memcpy(aad + 2, &hdr->addr1, 3 * ETH_ALEN); 557 562 } 558 563 559 564
+3 -9
net/wireless/mlme.c
··· 457 457 .reason_code = reason, 458 458 .ie = ie, 459 459 .ie_len = ie_len, 460 + .local_state_change = local_state_change, 460 461 }; 461 462 462 463 ASSERT_WDEV_LOCK(wdev); 463 464 464 - if (local_state_change) { 465 - if (wdev->current_bss && 466 - ether_addr_equal(wdev->current_bss->pub.bssid, bssid)) { 467 - cfg80211_unhold_bss(wdev->current_bss); 468 - cfg80211_put_bss(&wdev->current_bss->pub); 469 - wdev->current_bss = NULL; 470 - } 471 - 465 + if (local_state_change && (!wdev->current_bss || 466 + !ether_addr_equal(wdev->current_bss->pub.bssid, bssid))) 472 467 return 0; 473 - } 474 468 475 469 return rdev->ops->deauth(&rdev->wiphy, dev, &req); 476 470 }