diff options
author | Harvey Harrison <harvey.harrison@gmail.com> | 2008-07-02 19:30:52 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2008-07-08 14:16:01 -0400 |
commit | c34498b9e633baa3266af98106502633b6bc371b (patch) | |
tree | d3fea359c2c54f3b5b3c5630864ebb6c628a4b08 /net | |
parent | a7767f958a3b09a1bcd0ddcb21ef6f9a8ebd782c (diff) |
mac80211: wpa.c remove rx/tx_data ->fc users
Signed-off-by: Harvey Harrison <harvey.harrison@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'net')
-rw-r--r-- | net/mac80211/wpa.c | 21 |
1 files changed, 8 insertions, 13 deletions
diff --git a/net/mac80211/wpa.c b/net/mac80211/wpa.c index 241c932d3b6c..ec2ae86d64aa 100644 --- a/net/mac80211/wpa.c +++ b/net/mac80211/wpa.c | |||
@@ -28,19 +28,16 @@ ieee80211_tx_h_michael_mic_add(struct ieee80211_tx_data *tx) | |||
28 | size_t data_len; | 28 | size_t data_len; |
29 | unsigned int hdrlen; | 29 | unsigned int hdrlen; |
30 | struct ieee80211_hdr *hdr; | 30 | struct ieee80211_hdr *hdr; |
31 | u16 fc; | ||
32 | struct sk_buff *skb = tx->skb; | 31 | struct sk_buff *skb = tx->skb; |
33 | int authenticator; | 32 | int authenticator; |
34 | int wpa_test = 0; | 33 | int wpa_test = 0; |
35 | int tail; | 34 | int tail; |
36 | 35 | ||
37 | fc = tx->fc; | 36 | hdr = (struct ieee80211_hdr *)skb->data; |
38 | |||
39 | if (!tx->key || tx->key->conf.alg != ALG_TKIP || skb->len < 24 || | 37 | if (!tx->key || tx->key->conf.alg != ALG_TKIP || skb->len < 24 || |
40 | !WLAN_FC_DATA_PRESENT(fc)) | 38 | !ieee80211_is_data_present(hdr->frame_control)) |
41 | return TX_CONTINUE; | 39 | return TX_CONTINUE; |
42 | 40 | ||
43 | hdr = (struct ieee80211_hdr *)skb->data; | ||
44 | hdrlen = ieee80211_hdrlen(hdr->frame_control); | 41 | hdrlen = ieee80211_hdrlen(hdr->frame_control); |
45 | if (skb->len < hdrlen) | 42 | if (skb->len < hdrlen) |
46 | return TX_DROP; | 43 | return TX_DROP; |
@@ -90,25 +87,23 @@ ieee80211_rx_h_michael_mic_verify(struct ieee80211_rx_data *rx) | |||
90 | size_t data_len; | 87 | size_t data_len; |
91 | unsigned int hdrlen; | 88 | unsigned int hdrlen; |
92 | struct ieee80211_hdr *hdr; | 89 | struct ieee80211_hdr *hdr; |
93 | u16 fc; | ||
94 | u8 mic[MICHAEL_MIC_LEN]; | 90 | u8 mic[MICHAEL_MIC_LEN]; |
95 | struct sk_buff *skb = rx->skb; | 91 | struct sk_buff *skb = rx->skb; |
96 | int authenticator = 1, wpa_test = 0; | 92 | int authenticator = 1, wpa_test = 0; |
97 | DECLARE_MAC_BUF(mac); | 93 | DECLARE_MAC_BUF(mac); |
98 | 94 | ||
99 | fc = rx->fc; | ||
100 | |||
101 | /* | 95 | /* |
102 | * No way to verify the MIC if the hardware stripped it | 96 | * No way to verify the MIC if the hardware stripped it |
103 | */ | 97 | */ |
104 | if (rx->status->flag & RX_FLAG_MMIC_STRIPPED) | 98 | if (rx->status->flag & RX_FLAG_MMIC_STRIPPED) |
105 | return RX_CONTINUE; | 99 | return RX_CONTINUE; |
106 | 100 | ||
101 | hdr = (struct ieee80211_hdr *)skb->data; | ||
107 | if (!rx->key || rx->key->conf.alg != ALG_TKIP || | 102 | if (!rx->key || rx->key->conf.alg != ALG_TKIP || |
108 | !(rx->fc & IEEE80211_FCTL_PROTECTED) || !WLAN_FC_DATA_PRESENT(fc)) | 103 | !ieee80211_has_protected(hdr->frame_control) || |
104 | !ieee80211_is_data_present(hdr->frame_control)) | ||
109 | return RX_CONTINUE; | 105 | return RX_CONTINUE; |
110 | 106 | ||
111 | hdr = (struct ieee80211_hdr *)skb->data; | ||
112 | hdrlen = ieee80211_hdrlen(hdr->frame_control); | 107 | hdrlen = ieee80211_hdrlen(hdr->frame_control); |
113 | if (skb->len < hdrlen + MICHAEL_MIC_LEN) | 108 | if (skb->len < hdrlen + MICHAEL_MIC_LEN) |
114 | return RX_DROP_UNUSABLE; | 109 | return RX_DROP_UNUSABLE; |
@@ -239,7 +234,7 @@ ieee80211_crypto_tkip_decrypt(struct ieee80211_rx_data *rx) | |||
239 | 234 | ||
240 | hdrlen = ieee80211_hdrlen(hdr->frame_control); | 235 | hdrlen = ieee80211_hdrlen(hdr->frame_control); |
241 | 236 | ||
242 | if ((rx->fc & IEEE80211_FCTL_FTYPE) != IEEE80211_FTYPE_DATA) | 237 | if (!ieee80211_is_data(hdr->frame_control)) |
243 | return RX_CONTINUE; | 238 | return RX_CONTINUE; |
244 | 239 | ||
245 | if (!rx->sta || skb->len - hdrlen < 12) | 240 | if (!rx->sta || skb->len - hdrlen < 12) |
@@ -458,7 +453,7 @@ ieee80211_crypto_ccmp_encrypt(struct ieee80211_tx_data *tx) | |||
458 | ieee80211_rx_result | 453 | ieee80211_rx_result |
459 | ieee80211_crypto_ccmp_decrypt(struct ieee80211_rx_data *rx) | 454 | ieee80211_crypto_ccmp_decrypt(struct ieee80211_rx_data *rx) |
460 | { | 455 | { |
461 | struct ieee80211_hdr *hdr = (struct ieee80211_hdr *) rx->skb->data; | 456 | struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)rx->skb->data; |
462 | int hdrlen; | 457 | int hdrlen; |
463 | struct ieee80211_key *key = rx->key; | 458 | struct ieee80211_key *key = rx->key; |
464 | struct sk_buff *skb = rx->skb; | 459 | struct sk_buff *skb = rx->skb; |
@@ -468,7 +463,7 @@ ieee80211_crypto_ccmp_decrypt(struct ieee80211_rx_data *rx) | |||
468 | 463 | ||
469 | hdrlen = ieee80211_hdrlen(hdr->frame_control); | 464 | hdrlen = ieee80211_hdrlen(hdr->frame_control); |
470 | 465 | ||
471 | if ((rx->fc & IEEE80211_FCTL_FTYPE) != IEEE80211_FTYPE_DATA) | 466 | if (!ieee80211_is_data(hdr->frame_control)) |
472 | return RX_CONTINUE; | 467 | return RX_CONTINUE; |
473 | 468 | ||
474 | data_len = skb->len - hdrlen - CCMP_HDR_LEN - CCMP_MIC_LEN; | 469 | data_len = skb->len - hdrlen - CCMP_HDR_LEN - CCMP_MIC_LEN; |