提交 832855dc 编写于 作者: D Daniel Drake 提交者: Jeff Garzik

[PATCH] zd1211rw: Use compare_ether_addr()

Suggested by Maxime Austruy, based on mac80211 changes from Stephen
Hemminger
Signed-off-by: NDaniel Drake <dsd@gentoo.org>
Signed-off-by: NJohn W. Linville <linville@tuxdriver.com>
上级 6bab99be
...@@ -974,14 +974,14 @@ static int is_data_packet_for_us(struct ieee80211_device *ieee, ...@@ -974,14 +974,14 @@ static int is_data_packet_for_us(struct ieee80211_device *ieee,
switch (ieee->iw_mode) { switch (ieee->iw_mode) {
case IW_MODE_ADHOC: case IW_MODE_ADHOC:
if ((fc & (IEEE80211_FCTL_TODS|IEEE80211_FCTL_FROMDS)) != 0 || if ((fc & (IEEE80211_FCTL_TODS|IEEE80211_FCTL_FROMDS)) != 0 ||
memcmp(hdr->addr3, ieee->bssid, ETH_ALEN) != 0) compare_ether_addr(hdr->addr3, ieee->bssid) != 0)
return 0; return 0;
break; break;
case IW_MODE_AUTO: case IW_MODE_AUTO:
case IW_MODE_INFRA: case IW_MODE_INFRA:
if ((fc & (IEEE80211_FCTL_TODS|IEEE80211_FCTL_FROMDS)) != if ((fc & (IEEE80211_FCTL_TODS|IEEE80211_FCTL_FROMDS)) !=
IEEE80211_FCTL_FROMDS || IEEE80211_FCTL_FROMDS ||
memcmp(hdr->addr2, ieee->bssid, ETH_ALEN) != 0) compare_ether_addr(hdr->addr2, ieee->bssid) != 0)
return 0; return 0;
break; break;
default: default:
...@@ -989,9 +989,9 @@ static int is_data_packet_for_us(struct ieee80211_device *ieee, ...@@ -989,9 +989,9 @@ static int is_data_packet_for_us(struct ieee80211_device *ieee,
return 0; return 0;
} }
return memcmp(hdr->addr1, netdev->dev_addr, ETH_ALEN) == 0 || return compare_ether_addr(hdr->addr1, netdev->dev_addr) == 0 ||
(is_multicast_ether_addr(hdr->addr1) && (is_multicast_ether_addr(hdr->addr1) &&
memcmp(hdr->addr3, netdev->dev_addr, ETH_ALEN) != 0) || compare_ether_addr(hdr->addr3, netdev->dev_addr) != 0) ||
(netdev->flags & IFF_PROMISC); (netdev->flags & IFF_PROMISC);
} }
...@@ -1047,7 +1047,7 @@ static void update_qual_rssi(struct zd_mac *mac, ...@@ -1047,7 +1047,7 @@ static void update_qual_rssi(struct zd_mac *mac,
hdr = (struct ieee80211_hdr_3addr *)buffer; hdr = (struct ieee80211_hdr_3addr *)buffer;
if (length < offsetof(struct ieee80211_hdr_3addr, addr3)) if (length < offsetof(struct ieee80211_hdr_3addr, addr3))
return; return;
if (memcmp(hdr->addr2, zd_mac_to_ieee80211(mac)->bssid, ETH_ALEN) != 0) if (compare_ether_addr(hdr->addr2, zd_mac_to_ieee80211(mac)->bssid) != 0)
return; return;
spin_lock_irqsave(&mac->lock, flags); spin_lock_irqsave(&mac->lock, flags);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册