aboutsummaryrefslogtreecommitdiffstats
path: root/net/mac80211/rx.c
diff options
context:
space:
mode:
authorFelix Fietkau <nbd@openwrt.org>2012-03-01 09:22:09 -0500
committerJohn W. Linville <linville@tuxdriver.com>2012-03-05 15:38:31 -0500
commit888d04dfbe7e09f930fdaafb257cce2c54c9c3f3 (patch)
treecdf0c4d4008860fd91db31bcc620a8ecd3d95bc1 /net/mac80211/rx.c
parent4d196e4b2ffd734393b54f351507462f19d737b5 (diff)
mac80211: use compare_ether_addr on MAC addresses instead of memcmp
Because of the constant size and guaranteed 16 bit alignment, the inline compare_ether_addr function is much cheaper than calling memcmp. Signed-off-by: Felix Fietkau <nbd@openwrt.org> Acked-by: Johannes Berg <johannes@sipsolutions.net> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'net/mac80211/rx.c')
-rw-r--r--net/mac80211/rx.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/net/mac80211/rx.c b/net/mac80211/rx.c
index 7a4ff02af261..3cf011fc97f4 100644
--- a/net/mac80211/rx.c
+++ b/net/mac80211/rx.c
@@ -489,12 +489,12 @@ ieee80211_rx_mesh_check(struct ieee80211_rx_data *rx)
489 if (ieee80211_has_tods(hdr->frame_control) || 489 if (ieee80211_has_tods(hdr->frame_control) ||
490 !ieee80211_has_fromds(hdr->frame_control)) 490 !ieee80211_has_fromds(hdr->frame_control))
491 return RX_DROP_MONITOR; 491 return RX_DROP_MONITOR;
492 if (memcmp(hdr->addr3, dev_addr, ETH_ALEN) == 0) 492 if (compare_ether_addr(hdr->addr3, dev_addr) == 0)
493 return RX_DROP_MONITOR; 493 return RX_DROP_MONITOR;
494 } else { 494 } else {
495 if (!ieee80211_has_a4(hdr->frame_control)) 495 if (!ieee80211_has_a4(hdr->frame_control))
496 return RX_DROP_MONITOR; 496 return RX_DROP_MONITOR;
497 if (memcmp(hdr->addr4, dev_addr, ETH_ALEN) == 0) 497 if (compare_ether_addr(hdr->addr4, dev_addr) == 0)
498 return RX_DROP_MONITOR; 498 return RX_DROP_MONITOR;
499 } 499 }
500 } 500 }
@@ -2336,7 +2336,7 @@ ieee80211_rx_h_action(struct ieee80211_rx_data *rx)
2336 if (sdata->vif.type != NL80211_IFTYPE_STATION) 2336 if (sdata->vif.type != NL80211_IFTYPE_STATION)
2337 break; 2337 break;
2338 2338
2339 if (memcmp(mgmt->bssid, sdata->u.mgd.bssid, ETH_ALEN)) 2339 if (compare_ether_addr(mgmt->bssid, sdata->u.mgd.bssid))
2340 break; 2340 break;
2341 2341
2342 goto queue; 2342 goto queue;