diff options
author | Joe Perches <joe@perches.com> | 2007-10-03 20:59:30 -0400 |
---|---|---|
committer | David S. Miller <davem@sunset.davemloft.net> | 2007-10-10 19:51:42 -0400 |
commit | 0795af5729b18218767fab27c44b1384f72dc9ad (patch) | |
tree | 67c16df84aa6ec219340b8ea1b5cfb0e8150a216 /net/mac80211/wpa.c | |
parent | 95ea36275f3c9a1d3d04c217b4b576c657c4e70e (diff) |
[NET]: Introduce and use print_mac() and DECLARE_MAC_BUF()
This is nicer than the MAC_FMT stuff.
Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/mac80211/wpa.c')
-rw-r--r-- | net/mac80211/wpa.c | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/net/mac80211/wpa.c b/net/mac80211/wpa.c index 6e12638054aa..360d11e9de15 100644 --- a/net/mac80211/wpa.c +++ b/net/mac80211/wpa.c | |||
@@ -132,6 +132,7 @@ ieee80211_rx_h_michael_mic_verify(struct ieee80211_txrx_data *rx) | |||
132 | u8 mic[MICHAEL_MIC_LEN]; | 132 | u8 mic[MICHAEL_MIC_LEN]; |
133 | struct sk_buff *skb = rx->skb; | 133 | struct sk_buff *skb = rx->skb; |
134 | int authenticator = 1, wpa_test = 0; | 134 | int authenticator = 1, wpa_test = 0; |
135 | DECLARE_MAC_BUF(mac); | ||
135 | 136 | ||
136 | fc = rx->fc; | 137 | fc = rx->fc; |
137 | 138 | ||
@@ -164,7 +165,7 @@ ieee80211_rx_h_michael_mic_verify(struct ieee80211_txrx_data *rx) | |||
164 | return TXRX_DROP; | 165 | return TXRX_DROP; |
165 | 166 | ||
166 | printk(KERN_DEBUG "%s: invalid Michael MIC in data frame from " | 167 | printk(KERN_DEBUG "%s: invalid Michael MIC in data frame from " |
167 | MAC_FMT "\n", rx->dev->name, MAC_ARG(sa)); | 168 | "%s\n", rx->dev->name, print_mac(mac, sa)); |
168 | 169 | ||
169 | mac80211_ev_michael_mic_failure(rx->dev, rx->key->conf.keyidx, | 170 | mac80211_ev_michael_mic_failure(rx->dev, rx->key->conf.keyidx, |
170 | (void *) skb->data); | 171 | (void *) skb->data); |
@@ -287,6 +288,7 @@ ieee80211_rx_h_tkip_decrypt(struct ieee80211_txrx_data *rx) | |||
287 | int hdrlen, res, hwaccel = 0, wpa_test = 0; | 288 | int hdrlen, res, hwaccel = 0, wpa_test = 0; |
288 | struct ieee80211_key *key = rx->key; | 289 | struct ieee80211_key *key = rx->key; |
289 | struct sk_buff *skb = rx->skb; | 290 | struct sk_buff *skb = rx->skb; |
291 | DECLARE_MAC_BUF(mac); | ||
290 | 292 | ||
291 | fc = le16_to_cpu(hdr->frame_control); | 293 | fc = le16_to_cpu(hdr->frame_control); |
292 | hdrlen = ieee80211_get_hdrlen(fc); | 294 | hdrlen = ieee80211_get_hdrlen(fc); |
@@ -319,8 +321,8 @@ ieee80211_rx_h_tkip_decrypt(struct ieee80211_txrx_data *rx) | |||
319 | hwaccel, rx->u.rx.queue); | 321 | hwaccel, rx->u.rx.queue); |
320 | if (res != TKIP_DECRYPT_OK || wpa_test) { | 322 | if (res != TKIP_DECRYPT_OK || wpa_test) { |
321 | printk(KERN_DEBUG "%s: TKIP decrypt failed for RX frame from " | 323 | printk(KERN_DEBUG "%s: TKIP decrypt failed for RX frame from " |
322 | MAC_FMT " (res=%d)\n", | 324 | "%s (res=%d)\n", |
323 | rx->dev->name, MAC_ARG(rx->sta->addr), res); | 325 | rx->dev->name, print_mac(mac, rx->sta->addr), res); |
324 | return TXRX_DROP; | 326 | return TXRX_DROP; |
325 | } | 327 | } |
326 | 328 | ||
@@ -542,6 +544,7 @@ ieee80211_rx_h_ccmp_decrypt(struct ieee80211_txrx_data *rx) | |||
542 | struct sk_buff *skb = rx->skb; | 544 | struct sk_buff *skb = rx->skb; |
543 | u8 pn[CCMP_PN_LEN]; | 545 | u8 pn[CCMP_PN_LEN]; |
544 | int data_len; | 546 | int data_len; |
547 | DECLARE_MAC_BUF(mac); | ||
545 | 548 | ||
546 | fc = le16_to_cpu(hdr->frame_control); | 549 | fc = le16_to_cpu(hdr->frame_control); |
547 | hdrlen = ieee80211_get_hdrlen(fc); | 550 | hdrlen = ieee80211_get_hdrlen(fc); |
@@ -564,10 +567,11 @@ ieee80211_rx_h_ccmp_decrypt(struct ieee80211_txrx_data *rx) | |||
564 | if (memcmp(pn, key->u.ccmp.rx_pn[rx->u.rx.queue], CCMP_PN_LEN) <= 0) { | 567 | if (memcmp(pn, key->u.ccmp.rx_pn[rx->u.rx.queue], CCMP_PN_LEN) <= 0) { |
565 | #ifdef CONFIG_MAC80211_DEBUG | 568 | #ifdef CONFIG_MAC80211_DEBUG |
566 | u8 *ppn = key->u.ccmp.rx_pn[rx->u.rx.queue]; | 569 | u8 *ppn = key->u.ccmp.rx_pn[rx->u.rx.queue]; |
570 | |||
567 | printk(KERN_DEBUG "%s: CCMP replay detected for RX frame from " | 571 | printk(KERN_DEBUG "%s: CCMP replay detected for RX frame from " |
568 | MAC_FMT " (RX PN %02x%02x%02x%02x%02x%02x <= prev. PN " | 572 | "%s (RX PN %02x%02x%02x%02x%02x%02x <= prev. PN " |
569 | "%02x%02x%02x%02x%02x%02x)\n", rx->dev->name, | 573 | "%02x%02x%02x%02x%02x%02x)\n", rx->dev->name, |
570 | MAC_ARG(rx->sta->addr), | 574 | print_mac(mac, rx->sta->addr), |
571 | pn[0], pn[1], pn[2], pn[3], pn[4], pn[5], | 575 | pn[0], pn[1], pn[2], pn[3], pn[4], pn[5], |
572 | ppn[0], ppn[1], ppn[2], ppn[3], ppn[4], ppn[5]); | 576 | ppn[0], ppn[1], ppn[2], ppn[3], ppn[4], ppn[5]); |
573 | #endif /* CONFIG_MAC80211_DEBUG */ | 577 | #endif /* CONFIG_MAC80211_DEBUG */ |
@@ -591,8 +595,8 @@ ieee80211_rx_h_ccmp_decrypt(struct ieee80211_txrx_data *rx) | |||
591 | skb->data + skb->len - CCMP_MIC_LEN, | 595 | skb->data + skb->len - CCMP_MIC_LEN, |
592 | skb->data + hdrlen + CCMP_HDR_LEN)) { | 596 | skb->data + hdrlen + CCMP_HDR_LEN)) { |
593 | printk(KERN_DEBUG "%s: CCMP decrypt failed for RX " | 597 | printk(KERN_DEBUG "%s: CCMP decrypt failed for RX " |
594 | "frame from " MAC_FMT "\n", rx->dev->name, | 598 | "frame from %s\n", rx->dev->name, |
595 | MAC_ARG(rx->sta->addr)); | 599 | print_mac(mac, rx->sta->addr)); |
596 | return TXRX_DROP; | 600 | return TXRX_DROP; |
597 | } | 601 | } |
598 | } | 602 | } |
@@ -606,4 +610,3 @@ ieee80211_rx_h_ccmp_decrypt(struct ieee80211_txrx_data *rx) | |||
606 | 610 | ||
607 | return TXRX_CONTINUE; | 611 | return TXRX_CONTINUE; |
608 | } | 612 | } |
609 | |||