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>
This commit is contained in:
parent
a7767f958a
commit
c34498b9e6
1 changed files with 8 additions and 13 deletions
|
@ -28,19 +28,16 @@ ieee80211_tx_h_michael_mic_add(struct ieee80211_tx_data *tx)
|
||||||
size_t data_len;
|
size_t data_len;
|
||||||
unsigned int hdrlen;
|
unsigned int hdrlen;
|
||||||
struct ieee80211_hdr *hdr;
|
struct ieee80211_hdr *hdr;
|
||||||
u16 fc;
|
|
||||||
struct sk_buff *skb = tx->skb;
|
struct sk_buff *skb = tx->skb;
|
||||||
int authenticator;
|
int authenticator;
|
||||||
int wpa_test = 0;
|
int wpa_test = 0;
|
||||||
int tail;
|
int tail;
|
||||||
|
|
||||||
fc = tx->fc;
|
hdr = (struct ieee80211_hdr *)skb->data;
|
||||||
|
|
||||||
if (!tx->key || tx->key->conf.alg != ALG_TKIP || skb->len < 24 ||
|
if (!tx->key || tx->key->conf.alg != ALG_TKIP || skb->len < 24 ||
|
||||||
!WLAN_FC_DATA_PRESENT(fc))
|
!ieee80211_is_data_present(hdr->frame_control))
|
||||||
return TX_CONTINUE;
|
return TX_CONTINUE;
|
||||||
|
|
||||||
hdr = (struct ieee80211_hdr *)skb->data;
|
|
||||||
hdrlen = ieee80211_hdrlen(hdr->frame_control);
|
hdrlen = ieee80211_hdrlen(hdr->frame_control);
|
||||||
if (skb->len < hdrlen)
|
if (skb->len < hdrlen)
|
||||||
return TX_DROP;
|
return TX_DROP;
|
||||||
|
@ -90,25 +87,23 @@ ieee80211_rx_h_michael_mic_verify(struct ieee80211_rx_data *rx)
|
||||||
size_t data_len;
|
size_t data_len;
|
||||||
unsigned int hdrlen;
|
unsigned int hdrlen;
|
||||||
struct ieee80211_hdr *hdr;
|
struct ieee80211_hdr *hdr;
|
||||||
u16 fc;
|
|
||||||
u8 mic[MICHAEL_MIC_LEN];
|
u8 mic[MICHAEL_MIC_LEN];
|
||||||
struct sk_buff *skb = rx->skb;
|
struct sk_buff *skb = rx->skb;
|
||||||
int authenticator = 1, wpa_test = 0;
|
int authenticator = 1, wpa_test = 0;
|
||||||
DECLARE_MAC_BUF(mac);
|
DECLARE_MAC_BUF(mac);
|
||||||
|
|
||||||
fc = rx->fc;
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* No way to verify the MIC if the hardware stripped it
|
* No way to verify the MIC if the hardware stripped it
|
||||||
*/
|
*/
|
||||||
if (rx->status->flag & RX_FLAG_MMIC_STRIPPED)
|
if (rx->status->flag & RX_FLAG_MMIC_STRIPPED)
|
||||||
return RX_CONTINUE;
|
return RX_CONTINUE;
|
||||||
|
|
||||||
|
hdr = (struct ieee80211_hdr *)skb->data;
|
||||||
if (!rx->key || rx->key->conf.alg != ALG_TKIP ||
|
if (!rx->key || rx->key->conf.alg != ALG_TKIP ||
|
||||||
!(rx->fc & IEEE80211_FCTL_PROTECTED) || !WLAN_FC_DATA_PRESENT(fc))
|
!ieee80211_has_protected(hdr->frame_control) ||
|
||||||
|
!ieee80211_is_data_present(hdr->frame_control))
|
||||||
return RX_CONTINUE;
|
return RX_CONTINUE;
|
||||||
|
|
||||||
hdr = (struct ieee80211_hdr *)skb->data;
|
|
||||||
hdrlen = ieee80211_hdrlen(hdr->frame_control);
|
hdrlen = ieee80211_hdrlen(hdr->frame_control);
|
||||||
if (skb->len < hdrlen + MICHAEL_MIC_LEN)
|
if (skb->len < hdrlen + MICHAEL_MIC_LEN)
|
||||||
return RX_DROP_UNUSABLE;
|
return RX_DROP_UNUSABLE;
|
||||||
|
@ -239,7 +234,7 @@ ieee80211_crypto_tkip_decrypt(struct ieee80211_rx_data *rx)
|
||||||
|
|
||||||
hdrlen = ieee80211_hdrlen(hdr->frame_control);
|
hdrlen = ieee80211_hdrlen(hdr->frame_control);
|
||||||
|
|
||||||
if ((rx->fc & IEEE80211_FCTL_FTYPE) != IEEE80211_FTYPE_DATA)
|
if (!ieee80211_is_data(hdr->frame_control))
|
||||||
return RX_CONTINUE;
|
return RX_CONTINUE;
|
||||||
|
|
||||||
if (!rx->sta || skb->len - hdrlen < 12)
|
if (!rx->sta || skb->len - hdrlen < 12)
|
||||||
|
@ -458,7 +453,7 @@ ieee80211_crypto_ccmp_encrypt(struct ieee80211_tx_data *tx)
|
||||||
ieee80211_rx_result
|
ieee80211_rx_result
|
||||||
ieee80211_crypto_ccmp_decrypt(struct ieee80211_rx_data *rx)
|
ieee80211_crypto_ccmp_decrypt(struct ieee80211_rx_data *rx)
|
||||||
{
|
{
|
||||||
struct ieee80211_hdr *hdr = (struct ieee80211_hdr *) rx->skb->data;
|
struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)rx->skb->data;
|
||||||
int hdrlen;
|
int hdrlen;
|
||||||
struct ieee80211_key *key = rx->key;
|
struct ieee80211_key *key = rx->key;
|
||||||
struct sk_buff *skb = rx->skb;
|
struct sk_buff *skb = rx->skb;
|
||||||
|
@ -468,7 +463,7 @@ ieee80211_crypto_ccmp_decrypt(struct ieee80211_rx_data *rx)
|
||||||
|
|
||||||
hdrlen = ieee80211_hdrlen(hdr->frame_control);
|
hdrlen = ieee80211_hdrlen(hdr->frame_control);
|
||||||
|
|
||||||
if ((rx->fc & IEEE80211_FCTL_FTYPE) != IEEE80211_FTYPE_DATA)
|
if (!ieee80211_is_data(hdr->frame_control))
|
||||||
return RX_CONTINUE;
|
return RX_CONTINUE;
|
||||||
|
|
||||||
data_len = skb->len - hdrlen - CCMP_HDR_LEN - CCMP_MIC_LEN;
|
data_len = skb->len - hdrlen - CCMP_HDR_LEN - CCMP_MIC_LEN;
|
||||||
|
|
Loading…
Reference in a new issue