mac80211: remove unused status flag checks
authorJohannes Berg <johannes.berg@intel.com>
Tue, 10 Aug 2010 07:46:40 +0000 (09:46 +0200)
committerJohn W. Linville <linville@tuxdriver.com>
Mon, 16 Aug 2010 20:45:21 +0000 (16:45 -0400)
The decryption code verifies whether or not
a given frame was decrypted and verified by
hardware. This is unnecessary, as the crypto
RX handler already does it long before the
decryption code is even invoked, so remove
that code to avoid confusion.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
net/mac80211/rx.c
net/mac80211/wpa.c

index ad2427021b264422ed4aa55d3a2b34d3632a3461..4fdbed58ca2fcedd2ff18c9518b9e318f987a857 100644 (file)
@@ -899,6 +899,9 @@ ieee80211_rx_h_decrypt(struct ieee80211_rx_data *rx)
 
        if (!is_multicast_ether_addr(hdr->addr1) && stakey) {
                rx->key = stakey;
+               if ((status->flag & RX_FLAG_DECRYPTED) &&
+                   (status->flag & RX_FLAG_IV_STRIPPED))
+                       return RX_CONTINUE;
                /* Skip decryption if the frame is not protected. */
                if (!ieee80211_has_protected(fc))
                        return RX_CONTINUE;
index b08ad94b56da606be4433cab9df2da81ce9f482c..43882b36da5559feaf60751c92a9b48fbc1c90fa 100644 (file)
@@ -221,19 +221,13 @@ ieee80211_crypto_tkip_decrypt(struct ieee80211_rx_data *rx)
        if (!rx->sta || skb->len - hdrlen < 12)
                return RX_DROP_UNUSABLE;
 
-       if (status->flag & RX_FLAG_DECRYPTED) {
-               if (status->flag & RX_FLAG_IV_STRIPPED) {
-                       /*
-                        * Hardware took care of all processing, including
-                        * replay protection, and stripped the ICV/IV so
-                        * we cannot do any checks here.
-                        */
-                       return RX_CONTINUE;
-               }
-
-               /* let TKIP code verify IV, but skip decryption */
+       /*
+        * Let TKIP code verify IV, but skip decryption.
+        * In the case where hardware checks the IV as well,
+        * we don't even get here, see ieee80211_rx_h_decrypt()
+        */
+       if (status->flag & RX_FLAG_DECRYPTED)
                hwaccel = 1;
-       }
 
        res = ieee80211_tkip_decrypt_data(rx->local->wep_rx_tfm,
                                          key, skb->data + hdrlen,
@@ -447,10 +441,6 @@ ieee80211_crypto_ccmp_decrypt(struct ieee80211_rx_data *rx)
        if (!rx->sta || data_len < 0)
                return RX_DROP_UNUSABLE;
 
-       if ((status->flag & RX_FLAG_DECRYPTED) &&
-           (status->flag & RX_FLAG_IV_STRIPPED))
-               return RX_CONTINUE;
-
        ccmp_hdr2pn(pn, skb->data + hdrlen);
 
        queue = ieee80211_is_mgmt(hdr->frame_control) ?
@@ -564,10 +554,6 @@ ieee80211_crypto_aes_cmac_decrypt(struct ieee80211_rx_data *rx)
        if (!ieee80211_is_mgmt(hdr->frame_control))
                return RX_CONTINUE;
 
-       if ((status->flag & RX_FLAG_DECRYPTED) &&
-           (status->flag & RX_FLAG_IV_STRIPPED))
-               return RX_CONTINUE;
-
        if (skb->len < 24 + sizeof(*mmie))
                return RX_DROP_UNUSABLE;
 
This page took 0.030998 seconds and 5 git commands to generate.