]> git.proxmox.com Git - mirror_ubuntu-artful-kernel.git/commitdiff
Merge branch 'for-john' of git://git.kernel.org/pub/scm/linux/kernel/git/jberg/mac80211
authorJohn W. Linville <linville@tuxdriver.com>
Wed, 17 Oct 2012 20:23:33 +0000 (16:23 -0400)
committerJohn W. Linville <linville@tuxdriver.com>
Wed, 17 Oct 2012 20:23:33 +0000 (16:23 -0400)
1  2 
net/mac80211/wpa.c

diff --combined net/mac80211/wpa.c
index e72562a18bad0f184abb23578fbf5fec09b7fb38,e58bf3fe3ed912032b03d5bb76104c197409fd9a..8bd2f5c6a56edfa26193de6da2560c88d5ac75ce
@@@ -106,8 -106,7 +106,8 @@@ ieee80211_rx_h_michael_mic_verify(struc
                if (status->flag & RX_FLAG_MMIC_ERROR)
                        goto mic_fail;
  
 -              if (!(status->flag & RX_FLAG_IV_STRIPPED) && rx->key)
 +              if (!(status->flag & RX_FLAG_IV_STRIPPED) && rx->key &&
 +                  rx->key->conf.cipher == WLAN_CIPHER_SUITE_TKIP)
                        goto update_iv;
  
                return RX_CONTINUE;
@@@ -546,14 -545,19 +546,19 @@@ ieee80211_crypto_ccmp_decrypt(struct ie
  
  static void bip_aad(struct sk_buff *skb, u8 *aad)
  {
+       __le16 mask_fc;
+       struct ieee80211_hdr *hdr = (struct ieee80211_hdr *) skb->data;
        /* BIP AAD: FC(masked) || A1 || A2 || A3 */
  
        /* FC type/subtype */
-       aad[0] = skb->data[0];
        /* Mask FC Retry, PwrMgt, MoreData flags to zero */
-       aad[1] = skb->data[1] & ~(BIT(4) | BIT(5) | BIT(6));
+       mask_fc = hdr->frame_control;
+       mask_fc &= ~cpu_to_le16(IEEE80211_FCTL_RETRY | IEEE80211_FCTL_PM |
+                               IEEE80211_FCTL_MOREDATA);
+       put_unaligned(mask_fc, (__le16 *) &aad[0]);
        /* A1 || A2 || A3 */
-       memcpy(aad + 2, skb->data + 4, 3 * ETH_ALEN);
+       memcpy(aad + 2, &hdr->addr1, 3 * ETH_ALEN);
  }