hostap: slight optimization of addr compare
Use possibly more efficient ether_addr_equal instead of memcmp. Cc: Jouni Malinen <j@w1.fi> Cc: John W. Linville <linville@tuxdriver.com> Cc: linux-wireless@vger.kernel.org Cc: netdev@vger.kernel.org Cc: linux-kernel@vger.kernel.org Signed-off-by: Weilong Chen <chenweilong@huawei.com> Signed-off-by: Ding Tianhong <dingtianhong@huawei.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
5e231c2c5a
commit
d22fbd70c2
5 changed files with 22 additions and 24 deletions
|
@ -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,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue