From d22fbd70c2770b5e3ba0d7bc5b29f6ee686cdba4 Mon Sep 17 00:00:00 2001 From: dingtianhong Date: Thu, 26 Dec 2013 19:41:15 +0800 Subject: hostap: slight optimization of addr compare Use possibly more efficient ether_addr_equal instead of memcmp. Cc: Jouni Malinen Cc: John W. Linville Cc: linux-wireless@vger.kernel.org Cc: netdev@vger.kernel.org Cc: linux-kernel@vger.kernel.org Signed-off-by: Weilong Chen Signed-off-by: Ding Tianhong Signed-off-by: David S. Miller --- drivers/net/wireless/hostap/hostap_main.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'drivers/net/wireless/hostap/hostap_main.c') diff --git a/drivers/net/wireless/hostap/hostap_main.c b/drivers/net/wireless/hostap/hostap_main.c index a1257c92afc..67db34e56d7 100644 --- a/drivers/net/wireless/hostap/hostap_main.c +++ b/drivers/net/wireless/hostap/hostap_main.c @@ -155,8 +155,7 @@ int prism2_wds_add(local_info_t *local, u8 *remote_addr, if (prism2_wds_special_addr(iface->u.wds.remote_addr)) empty = iface; - else if (memcmp(iface->u.wds.remote_addr, remote_addr, - ETH_ALEN) == 0) { + else if (ether_addr_equal(iface->u.wds.remote_addr, remote_addr)) { match = iface; break; } @@ -214,8 +213,7 @@ int prism2_wds_del(local_info_t *local, u8 *remote_addr, if (iface->type != HOSTAP_INTERFACE_WDS) continue; - if (memcmp(iface->u.wds.remote_addr, remote_addr, - ETH_ALEN) == 0) { + if (ether_addr_equal(iface->u.wds.remote_addr, remote_addr)) { selected = iface; break; } @@ -1085,7 +1083,7 @@ int prism2_sta_deauth(local_info_t *local, u16 reason) if (local->iw_mode != IW_MODE_INFRA || is_zero_ether_addr(local->bssid) || - memcmp(local->bssid, "\x44\x44\x44\x44\x44\x44", ETH_ALEN) == 0) + ether_addr_equal(local->bssid, "\x44\x44\x44\x44\x44\x44")) return 0; ret = prism2_sta_send_mgmt(local, local->bssid, IEEE80211_STYPE_DEAUTH, -- cgit v1.2.3-70-g09d2