diff options
author | Felix Fietkau <nbd@openwrt.org> | 2012-03-01 15:22:09 +0100 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2012-03-05 15:38:31 -0500 |
commit | 888d04dfbe7e09f930fdaafb257cce2c54c9c3f3 (patch) | |
tree | cdf0c4d4008860fd91db31bcc620a8ecd3d95bc1 /net/mac80211/rx.c | |
parent | 4d196e4b2ffd734393b54f351507462f19d737b5 (diff) | |
download | op-kernel-dev-888d04dfbe7e09f930fdaafb257cce2c54c9c3f3.zip op-kernel-dev-888d04dfbe7e09f930fdaafb257cce2c54c9c3f3.tar.gz |
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.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/net/mac80211/rx.c b/net/mac80211/rx.c index 7a4ff02..3cf011f 100644 --- a/net/mac80211/rx.c +++ b/net/mac80211/rx.c @@ -489,12 +489,12 @@ ieee80211_rx_mesh_check(struct ieee80211_rx_data *rx) if (ieee80211_has_tods(hdr->frame_control) || !ieee80211_has_fromds(hdr->frame_control)) return RX_DROP_MONITOR; - if (memcmp(hdr->addr3, dev_addr, ETH_ALEN) == 0) + if (compare_ether_addr(hdr->addr3, dev_addr) == 0) return RX_DROP_MONITOR; } else { if (!ieee80211_has_a4(hdr->frame_control)) return RX_DROP_MONITOR; - if (memcmp(hdr->addr4, dev_addr, ETH_ALEN) == 0) + if (compare_ether_addr(hdr->addr4, dev_addr) == 0) return RX_DROP_MONITOR; } } @@ -2336,7 +2336,7 @@ ieee80211_rx_h_action(struct ieee80211_rx_data *rx) if (sdata->vif.type != NL80211_IFTYPE_STATION) break; - if (memcmp(mgmt->bssid, sdata->u.mgd.bssid, ETH_ALEN)) + if (compare_ether_addr(mgmt->bssid, sdata->u.mgd.bssid)) break; goto queue; |