diff options
author | Johannes Berg <johannes@sipsolutions.net> | 2008-01-31 13:48:21 -0500 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2008-02-29 15:37:02 -0500 |
commit | e4c26add8893e40e6e809b8c1ebc81e37762af2b (patch) | |
tree | fb11a53da8c2cc6af47ca5436ce41cf7068b3949 /net/mac80211/wpa.c | |
parent | 9ae54c8463691b64ca6e6d8680787a6527810984 (diff) |
mac80211: split RX_DROP
Some instances of RX_DROP mean that the frame was useless,
others mean that the frame should be visible in userspace
on "cooked" monitor interfaces. This patch splits up RX_DROP
and changes each instance appropriately.
Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'net/mac80211/wpa.c')
-rw-r--r-- | net/mac80211/wpa.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/net/mac80211/wpa.c b/net/mac80211/wpa.c index c628fa93f574..b35e51c6ce0c 100644 --- a/net/mac80211/wpa.c +++ b/net/mac80211/wpa.c | |||
@@ -148,7 +148,7 @@ ieee80211_rx_h_michael_mic_verify(struct ieee80211_txrx_data *rx) | |||
148 | 148 | ||
149 | if (ieee80211_get_hdr_info(skb, &sa, &da, &qos_tid, &data, &data_len) | 149 | if (ieee80211_get_hdr_info(skb, &sa, &da, &qos_tid, &data, &data_len) |
150 | || data_len < MICHAEL_MIC_LEN) | 150 | || data_len < MICHAEL_MIC_LEN) |
151 | return RX_DROP; | 151 | return RX_DROP_UNUSABLE; |
152 | 152 | ||
153 | data_len -= MICHAEL_MIC_LEN; | 153 | data_len -= MICHAEL_MIC_LEN; |
154 | 154 | ||
@@ -162,14 +162,14 @@ ieee80211_rx_h_michael_mic_verify(struct ieee80211_txrx_data *rx) | |||
162 | michael_mic(key, da, sa, qos_tid & 0x0f, data, data_len, mic); | 162 | michael_mic(key, da, sa, qos_tid & 0x0f, data, data_len, mic); |
163 | if (memcmp(mic, data + data_len, MICHAEL_MIC_LEN) != 0 || wpa_test) { | 163 | if (memcmp(mic, data + data_len, MICHAEL_MIC_LEN) != 0 || wpa_test) { |
164 | if (!(rx->flags & IEEE80211_TXRXD_RXRA_MATCH)) | 164 | if (!(rx->flags & IEEE80211_TXRXD_RXRA_MATCH)) |
165 | return RX_DROP; | 165 | return RX_DROP_UNUSABLE; |
166 | 166 | ||
167 | printk(KERN_DEBUG "%s: invalid Michael MIC in data frame from " | 167 | printk(KERN_DEBUG "%s: invalid Michael MIC in data frame from " |
168 | "%s\n", rx->dev->name, print_mac(mac, sa)); | 168 | "%s\n", rx->dev->name, print_mac(mac, sa)); |
169 | 169 | ||
170 | mac80211_ev_michael_mic_failure(rx->dev, rx->key->conf.keyidx, | 170 | mac80211_ev_michael_mic_failure(rx->dev, rx->key->conf.keyidx, |
171 | (void *) skb->data); | 171 | (void *) skb->data); |
172 | return RX_DROP; | 172 | return RX_DROP_UNUSABLE; |
173 | } | 173 | } |
174 | 174 | ||
175 | /* remove Michael MIC from payload */ | 175 | /* remove Michael MIC from payload */ |
@@ -293,7 +293,7 @@ ieee80211_crypto_tkip_decrypt(struct ieee80211_txrx_data *rx) | |||
293 | return RX_CONTINUE; | 293 | return RX_CONTINUE; |
294 | 294 | ||
295 | if (!rx->sta || skb->len - hdrlen < 12) | 295 | if (!rx->sta || skb->len - hdrlen < 12) |
296 | return RX_DROP; | 296 | return RX_DROP_UNUSABLE; |
297 | 297 | ||
298 | if (rx->u.rx.status->flag & RX_FLAG_DECRYPTED) { | 298 | if (rx->u.rx.status->flag & RX_FLAG_DECRYPTED) { |
299 | if (rx->u.rx.status->flag & RX_FLAG_IV_STRIPPED) { | 299 | if (rx->u.rx.status->flag & RX_FLAG_IV_STRIPPED) { |
@@ -322,7 +322,7 @@ ieee80211_crypto_tkip_decrypt(struct ieee80211_txrx_data *rx) | |||
322 | "frame from %s (res=%d)\n", rx->dev->name, | 322 | "frame from %s (res=%d)\n", rx->dev->name, |
323 | print_mac(mac, rx->sta->addr), res); | 323 | print_mac(mac, rx->sta->addr), res); |
324 | #endif /* CONFIG_MAC80211_DEBUG */ | 324 | #endif /* CONFIG_MAC80211_DEBUG */ |
325 | return RX_DROP; | 325 | return RX_DROP_UNUSABLE; |
326 | } | 326 | } |
327 | 327 | ||
328 | /* Trim ICV */ | 328 | /* Trim ICV */ |
@@ -545,7 +545,7 @@ ieee80211_crypto_ccmp_decrypt(struct ieee80211_txrx_data *rx) | |||
545 | 545 | ||
546 | data_len = skb->len - hdrlen - CCMP_HDR_LEN - CCMP_MIC_LEN; | 546 | data_len = skb->len - hdrlen - CCMP_HDR_LEN - CCMP_MIC_LEN; |
547 | if (!rx->sta || data_len < 0) | 547 | if (!rx->sta || data_len < 0) |
548 | return RX_DROP; | 548 | return RX_DROP_UNUSABLE; |
549 | 549 | ||
550 | if ((rx->u.rx.status->flag & RX_FLAG_DECRYPTED) && | 550 | if ((rx->u.rx.status->flag & RX_FLAG_DECRYPTED) && |
551 | (rx->u.rx.status->flag & RX_FLAG_IV_STRIPPED)) | 551 | (rx->u.rx.status->flag & RX_FLAG_IV_STRIPPED)) |
@@ -565,7 +565,7 @@ ieee80211_crypto_ccmp_decrypt(struct ieee80211_txrx_data *rx) | |||
565 | ppn[0], ppn[1], ppn[2], ppn[3], ppn[4], ppn[5]); | 565 | ppn[0], ppn[1], ppn[2], ppn[3], ppn[4], ppn[5]); |
566 | #endif /* CONFIG_MAC80211_DEBUG */ | 566 | #endif /* CONFIG_MAC80211_DEBUG */ |
567 | key->u.ccmp.replays++; | 567 | key->u.ccmp.replays++; |
568 | return RX_DROP; | 568 | return RX_DROP_UNUSABLE; |
569 | } | 569 | } |
570 | 570 | ||
571 | if (!(rx->u.rx.status->flag & RX_FLAG_DECRYPTED)) { | 571 | if (!(rx->u.rx.status->flag & RX_FLAG_DECRYPTED)) { |
@@ -589,7 +589,7 @@ ieee80211_crypto_ccmp_decrypt(struct ieee80211_txrx_data *rx) | |||
589 | "for RX frame from %s\n", rx->dev->name, | 589 | "for RX frame from %s\n", rx->dev->name, |
590 | print_mac(mac, rx->sta->addr)); | 590 | print_mac(mac, rx->sta->addr)); |
591 | #endif /* CONFIG_MAC80211_DEBUG */ | 591 | #endif /* CONFIG_MAC80211_DEBUG */ |
592 | return RX_DROP; | 592 | return RX_DROP_UNUSABLE; |
593 | } | 593 | } |
594 | } | 594 | } |
595 | 595 | ||