diff options
Diffstat (limited to 'net/ieee80211/ieee80211_rx.c')
-rw-r--r-- | net/ieee80211/ieee80211_rx.c | 71 |
1 files changed, 23 insertions, 48 deletions
diff --git a/net/ieee80211/ieee80211_rx.c b/net/ieee80211/ieee80211_rx.c index 69dbc342a464..281223e41c58 100644 --- a/net/ieee80211/ieee80211_rx.c +++ b/net/ieee80211/ieee80211_rx.c | |||
@@ -282,12 +282,8 @@ ieee80211_rx_frame_decrypt(struct ieee80211_device *ieee, struct sk_buff *skb, | |||
282 | res = crypt->ops->decrypt_mpdu(skb, hdrlen, crypt->priv); | 282 | res = crypt->ops->decrypt_mpdu(skb, hdrlen, crypt->priv); |
283 | atomic_dec(&crypt->refcnt); | 283 | atomic_dec(&crypt->refcnt); |
284 | if (res < 0) { | 284 | if (res < 0) { |
285 | IEEE80211_DEBUG_DROP("decryption failed (SA=" MAC_FMT | 285 | IEEE80211_DEBUG_DROP("decryption failed (SA=%pM) res=%d\n", |
286 | ") res=%d\n", | 286 | hdr->addr2, res); |
287 | hdr->addr2[0], hdr->addr2[1], | ||
288 | hdr->addr2[2], hdr->addr2[3], | ||
289 | hdr->addr2[4], hdr->addr2[5], | ||
290 | res); | ||
291 | if (res == -2) | 287 | if (res == -2) |
292 | IEEE80211_DEBUG_DROP("Decryption failed ICV " | 288 | IEEE80211_DEBUG_DROP("Decryption failed ICV " |
293 | "mismatch (key %d)\n", | 289 | "mismatch (key %d)\n", |
@@ -319,11 +315,7 @@ ieee80211_rx_frame_decrypt_msdu(struct ieee80211_device *ieee, | |||
319 | atomic_dec(&crypt->refcnt); | 315 | atomic_dec(&crypt->refcnt); |
320 | if (res < 0) { | 316 | if (res < 0) { |
321 | printk(KERN_DEBUG "%s: MSDU decryption/MIC verification failed" | 317 | printk(KERN_DEBUG "%s: MSDU decryption/MIC verification failed" |
322 | " (SA=" MAC_FMT " keyidx=%d)\n", | 318 | " (SA=%pM keyidx=%d)\n", ieee->dev->name, hdr->addr2, |
323 | ieee->dev->name, | ||
324 | hdr->addr2[0], hdr->addr2[1], | ||
325 | hdr->addr2[2], hdr->addr2[3], | ||
326 | hdr->addr2[4], hdr->addr2[5], | ||
327 | keyidx); | 319 | keyidx); |
328 | return -1; | 320 | return -1; |
329 | } | 321 | } |
@@ -358,7 +350,6 @@ int ieee80211_rx(struct ieee80211_device *ieee, struct sk_buff *skb, | |||
358 | struct ieee80211_crypt_data *crypt = NULL; | 350 | struct ieee80211_crypt_data *crypt = NULL; |
359 | int keyidx = 0; | 351 | int keyidx = 0; |
360 | int can_be_decrypted = 0; | 352 | int can_be_decrypted = 0; |
361 | DECLARE_MAC_BUF(mac); | ||
362 | 353 | ||
363 | hdr = (struct ieee80211_hdr_4addr *)skb->data; | 354 | hdr = (struct ieee80211_hdr_4addr *)skb->data; |
364 | stats = &ieee->stats; | 355 | stats = &ieee->stats; |
@@ -468,10 +459,7 @@ int ieee80211_rx(struct ieee80211_device *ieee, struct sk_buff *skb, | |||
468 | * frames silently instead of filling system log with | 459 | * frames silently instead of filling system log with |
469 | * these reports. */ | 460 | * these reports. */ |
470 | IEEE80211_DEBUG_DROP("Decryption failed (not set)" | 461 | IEEE80211_DEBUG_DROP("Decryption failed (not set)" |
471 | " (SA=" MAC_FMT ")\n", | 462 | " (SA=%pM)\n", hdr->addr2); |
472 | hdr->addr2[0], hdr->addr2[1], | ||
473 | hdr->addr2[2], hdr->addr2[3], | ||
474 | hdr->addr2[4], hdr->addr2[5]); | ||
475 | ieee->ieee_stats.rx_discards_undecryptable++; | 463 | ieee->ieee_stats.rx_discards_undecryptable++; |
476 | goto rx_dropped; | 464 | goto rx_dropped; |
477 | } | 465 | } |
@@ -482,10 +470,7 @@ int ieee80211_rx(struct ieee80211_device *ieee, struct sk_buff *skb, | |||
482 | fc & IEEE80211_FCTL_PROTECTED && ieee->host_decrypt && | 470 | fc & IEEE80211_FCTL_PROTECTED && ieee->host_decrypt && |
483 | (keyidx = hostap_rx_frame_decrypt(ieee, skb, crypt)) < 0) { | 471 | (keyidx = hostap_rx_frame_decrypt(ieee, skb, crypt)) < 0) { |
484 | printk(KERN_DEBUG "%s: failed to decrypt mgmt::auth " | 472 | printk(KERN_DEBUG "%s: failed to decrypt mgmt::auth " |
485 | "from " MAC_FMT "\n", dev->name, | 473 | "from %pM\n", dev->name, hdr->addr2); |
486 | hdr->addr2[0], hdr->addr2[1], | ||
487 | hdr->addr2[2], hdr->addr2[3], | ||
488 | hdr->addr2[4], hdr->addr2[5]); | ||
489 | /* TODO: could inform hostapd about this so that it | 474 | /* TODO: could inform hostapd about this so that it |
490 | * could send auth failure report */ | 475 | * could send auth failure report */ |
491 | goto rx_dropped; | 476 | goto rx_dropped; |
@@ -663,11 +648,8 @@ int ieee80211_rx(struct ieee80211_device *ieee, struct sk_buff *skb, | |||
663 | * configured */ | 648 | * configured */ |
664 | } else { | 649 | } else { |
665 | IEEE80211_DEBUG_DROP("encryption configured, but RX " | 650 | IEEE80211_DEBUG_DROP("encryption configured, but RX " |
666 | "frame not encrypted (SA=" | 651 | "frame not encrypted (SA=%pM)\n", |
667 | MAC_FMT ")\n", | 652 | hdr->addr2); |
668 | hdr->addr2[0], hdr->addr2[1], | ||
669 | hdr->addr2[2], hdr->addr2[3], | ||
670 | hdr->addr2[4], hdr->addr2[5]); | ||
671 | goto rx_dropped; | 653 | goto rx_dropped; |
672 | } | 654 | } |
673 | } | 655 | } |
@@ -675,11 +657,8 @@ int ieee80211_rx(struct ieee80211_device *ieee, struct sk_buff *skb, | |||
675 | if (crypt && !(fc & IEEE80211_FCTL_PROTECTED) && !ieee->open_wep && | 657 | if (crypt && !(fc & IEEE80211_FCTL_PROTECTED) && !ieee->open_wep && |
676 | !ieee80211_is_eapol_frame(ieee, skb)) { | 658 | !ieee80211_is_eapol_frame(ieee, skb)) { |
677 | IEEE80211_DEBUG_DROP("dropped unencrypted RX data " | 659 | IEEE80211_DEBUG_DROP("dropped unencrypted RX data " |
678 | "frame from " MAC_FMT | 660 | "frame from %pM (drop_unencrypted=1)\n", |
679 | " (drop_unencrypted=1)\n", | 661 | hdr->addr2); |
680 | hdr->addr2[0], hdr->addr2[1], | ||
681 | hdr->addr2[2], hdr->addr2[3], | ||
682 | hdr->addr2[4], hdr->addr2[5]); | ||
683 | goto rx_dropped; | 662 | goto rx_dropped; |
684 | } | 663 | } |
685 | 664 | ||
@@ -1429,8 +1408,6 @@ static int ieee80211_network_init(struct ieee80211_device *ieee, struct ieee8021 | |||
1429 | struct ieee80211_network *network, | 1408 | struct ieee80211_network *network, |
1430 | struct ieee80211_rx_stats *stats) | 1409 | struct ieee80211_rx_stats *stats) |
1431 | { | 1410 | { |
1432 | DECLARE_MAC_BUF(mac); | ||
1433 | |||
1434 | network->qos_data.active = 0; | 1411 | network->qos_data.active = 0; |
1435 | network->qos_data.supported = 0; | 1412 | network->qos_data.supported = 0; |
1436 | network->qos_data.param_count = 0; | 1413 | network->qos_data.param_count = 0; |
@@ -1477,11 +1454,11 @@ static int ieee80211_network_init(struct ieee80211_device *ieee, struct ieee8021 | |||
1477 | } | 1454 | } |
1478 | 1455 | ||
1479 | if (network->mode == 0) { | 1456 | if (network->mode == 0) { |
1480 | IEEE80211_DEBUG_SCAN("Filtered out '%s (%s)' " | 1457 | IEEE80211_DEBUG_SCAN("Filtered out '%s (%pM)' " |
1481 | "network.\n", | 1458 | "network.\n", |
1482 | escape_essid(network->ssid, | 1459 | escape_essid(network->ssid, |
1483 | network->ssid_len), | 1460 | network->ssid_len), |
1484 | print_mac(mac, network->bssid)); | 1461 | network->bssid); |
1485 | return 1; | 1462 | return 1; |
1486 | } | 1463 | } |
1487 | 1464 | ||
@@ -1510,7 +1487,6 @@ static void update_network(struct ieee80211_network *dst, | |||
1510 | { | 1487 | { |
1511 | int qos_active; | 1488 | int qos_active; |
1512 | u8 old_param; | 1489 | u8 old_param; |
1513 | DECLARE_MAC_BUF(mac); | ||
1514 | 1490 | ||
1515 | ieee80211_network_reset(dst); | 1491 | ieee80211_network_reset(dst); |
1516 | dst->ibss_dfs = src->ibss_dfs; | 1492 | dst->ibss_dfs = src->ibss_dfs; |
@@ -1524,8 +1500,8 @@ static void update_network(struct ieee80211_network *dst, | |||
1524 | memcpy(&dst->stats, &src->stats, | 1500 | memcpy(&dst->stats, &src->stats, |
1525 | sizeof(struct ieee80211_rx_stats)); | 1501 | sizeof(struct ieee80211_rx_stats)); |
1526 | else | 1502 | else |
1527 | IEEE80211_DEBUG_SCAN("Network %s info received " | 1503 | IEEE80211_DEBUG_SCAN("Network %pM info received " |
1528 | "off channel (%d vs. %d)\n", print_mac(mac, src->bssid), | 1504 | "off channel (%d vs. %d)\n", src->bssid, |
1529 | dst->channel, src->stats.received_channel); | 1505 | dst->channel, src->stats.received_channel); |
1530 | 1506 | ||
1531 | dst->capability = src->capability; | 1507 | dst->capability = src->capability; |
@@ -1597,12 +1573,11 @@ static void ieee80211_process_probe_response(struct ieee80211_device | |||
1597 | struct ieee80211_info_element *info_element = beacon->info_element; | 1573 | struct ieee80211_info_element *info_element = beacon->info_element; |
1598 | #endif | 1574 | #endif |
1599 | unsigned long flags; | 1575 | unsigned long flags; |
1600 | DECLARE_MAC_BUF(mac); | ||
1601 | 1576 | ||
1602 | IEEE80211_DEBUG_SCAN("'%s' (%s" | 1577 | IEEE80211_DEBUG_SCAN("'%s' (%pM" |
1603 | "): %c%c%c%c %c%c%c%c-%c%c%c%c %c%c%c%c\n", | 1578 | "): %c%c%c%c %c%c%c%c-%c%c%c%c %c%c%c%c\n", |
1604 | escape_essid(info_element->data, info_element->len), | 1579 | escape_essid(info_element->data, info_element->len), |
1605 | print_mac(mac, beacon->header.addr3), | 1580 | beacon->header.addr3, |
1606 | (beacon->capability & cpu_to_le16(1 << 0xf)) ? '1' : '0', | 1581 | (beacon->capability & cpu_to_le16(1 << 0xf)) ? '1' : '0', |
1607 | (beacon->capability & cpu_to_le16(1 << 0xe)) ? '1' : '0', | 1582 | (beacon->capability & cpu_to_le16(1 << 0xe)) ? '1' : '0', |
1608 | (beacon->capability & cpu_to_le16(1 << 0xd)) ? '1' : '0', | 1583 | (beacon->capability & cpu_to_le16(1 << 0xd)) ? '1' : '0', |
@@ -1621,10 +1596,10 @@ static void ieee80211_process_probe_response(struct ieee80211_device | |||
1621 | (beacon->capability & cpu_to_le16(1 << 0x0)) ? '1' : '0'); | 1596 | (beacon->capability & cpu_to_le16(1 << 0x0)) ? '1' : '0'); |
1622 | 1597 | ||
1623 | if (ieee80211_network_init(ieee, beacon, &network, stats)) { | 1598 | if (ieee80211_network_init(ieee, beacon, &network, stats)) { |
1624 | IEEE80211_DEBUG_SCAN("Dropped '%s' (%s) via %s.\n", | 1599 | IEEE80211_DEBUG_SCAN("Dropped '%s' (%pM) via %s.\n", |
1625 | escape_essid(info_element->data, | 1600 | escape_essid(info_element->data, |
1626 | info_element->len), | 1601 | info_element->len), |
1627 | print_mac(mac, beacon->header.addr3), | 1602 | beacon->header.addr3, |
1628 | is_beacon(beacon->header.frame_ctl) ? | 1603 | is_beacon(beacon->header.frame_ctl) ? |
1629 | "BEACON" : "PROBE RESPONSE"); | 1604 | "BEACON" : "PROBE RESPONSE"); |
1630 | return; | 1605 | return; |
@@ -1658,11 +1633,11 @@ static void ieee80211_process_probe_response(struct ieee80211_device | |||
1658 | /* If there are no more slots, expire the oldest */ | 1633 | /* If there are no more slots, expire the oldest */ |
1659 | list_del(&oldest->list); | 1634 | list_del(&oldest->list); |
1660 | target = oldest; | 1635 | target = oldest; |
1661 | IEEE80211_DEBUG_SCAN("Expired '%s' (%s) from " | 1636 | IEEE80211_DEBUG_SCAN("Expired '%s' (%pM) from " |
1662 | "network list.\n", | 1637 | "network list.\n", |
1663 | escape_essid(target->ssid, | 1638 | escape_essid(target->ssid, |
1664 | target->ssid_len), | 1639 | target->ssid_len), |
1665 | print_mac(mac, target->bssid)); | 1640 | target->bssid); |
1666 | ieee80211_network_reset(target); | 1641 | ieee80211_network_reset(target); |
1667 | } else { | 1642 | } else { |
1668 | /* Otherwise just pull from the free list */ | 1643 | /* Otherwise just pull from the free list */ |
@@ -1672,10 +1647,10 @@ static void ieee80211_process_probe_response(struct ieee80211_device | |||
1672 | } | 1647 | } |
1673 | 1648 | ||
1674 | #ifdef CONFIG_IEEE80211_DEBUG | 1649 | #ifdef CONFIG_IEEE80211_DEBUG |
1675 | IEEE80211_DEBUG_SCAN("Adding '%s' (%s) via %s.\n", | 1650 | IEEE80211_DEBUG_SCAN("Adding '%s' (%pM) via %s.\n", |
1676 | escape_essid(network.ssid, | 1651 | escape_essid(network.ssid, |
1677 | network.ssid_len), | 1652 | network.ssid_len), |
1678 | print_mac(mac, network.bssid), | 1653 | network.bssid, |
1679 | is_beacon(beacon->header.frame_ctl) ? | 1654 | is_beacon(beacon->header.frame_ctl) ? |
1680 | "BEACON" : "PROBE RESPONSE"); | 1655 | "BEACON" : "PROBE RESPONSE"); |
1681 | #endif | 1656 | #endif |
@@ -1683,10 +1658,10 @@ static void ieee80211_process_probe_response(struct ieee80211_device | |||
1683 | network.ibss_dfs = NULL; | 1658 | network.ibss_dfs = NULL; |
1684 | list_add_tail(&target->list, &ieee->network_list); | 1659 | list_add_tail(&target->list, &ieee->network_list); |
1685 | } else { | 1660 | } else { |
1686 | IEEE80211_DEBUG_SCAN("Updating '%s' (%s) via %s.\n", | 1661 | IEEE80211_DEBUG_SCAN("Updating '%s' (%pM) via %s.\n", |
1687 | escape_essid(target->ssid, | 1662 | escape_essid(target->ssid, |
1688 | target->ssid_len), | 1663 | target->ssid_len), |
1689 | print_mac(mac, target->bssid), | 1664 | target->bssid, |
1690 | is_beacon(beacon->header.frame_ctl) ? | 1665 | is_beacon(beacon->header.frame_ctl) ? |
1691 | "BEACON" : "PROBE RESPONSE"); | 1666 | "BEACON" : "PROBE RESPONSE"); |
1692 | update_network(target, &network); | 1667 | update_network(target, &network); |