diff options
author | dingtianhong <dingtianhong@huawei.com> | 2013-12-26 06:41:15 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2013-12-26 13:31:35 -0500 |
commit | d22fbd70c2770b5e3ba0d7bc5b29f6ee686cdba4 (patch) | |
tree | 5ae7fe8532ab5d1739b99f7046f6d4907294fd8c /drivers/net/wireless/hostap/hostap_main.c | |
parent | 5e231c2c5aeda0763c0b6e1337ca7bb61a887af8 (diff) |
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>
Diffstat (limited to 'drivers/net/wireless/hostap/hostap_main.c')
-rw-r--r-- | drivers/net/wireless/hostap/hostap_main.c | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/drivers/net/wireless/hostap/hostap_main.c b/drivers/net/wireless/hostap/hostap_main.c index a1257c92afc4..67db34e56d7e 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, | |||
155 | 155 | ||
156 | if (prism2_wds_special_addr(iface->u.wds.remote_addr)) | 156 | if (prism2_wds_special_addr(iface->u.wds.remote_addr)) |
157 | empty = iface; | 157 | empty = iface; |
158 | else if (memcmp(iface->u.wds.remote_addr, remote_addr, | 158 | else if (ether_addr_equal(iface->u.wds.remote_addr, remote_addr)) { |
159 | ETH_ALEN) == 0) { | ||
160 | match = iface; | 159 | match = iface; |
161 | break; | 160 | break; |
162 | } | 161 | } |
@@ -214,8 +213,7 @@ int prism2_wds_del(local_info_t *local, u8 *remote_addr, | |||
214 | if (iface->type != HOSTAP_INTERFACE_WDS) | 213 | if (iface->type != HOSTAP_INTERFACE_WDS) |
215 | continue; | 214 | continue; |
216 | 215 | ||
217 | if (memcmp(iface->u.wds.remote_addr, remote_addr, | 216 | if (ether_addr_equal(iface->u.wds.remote_addr, remote_addr)) { |
218 | ETH_ALEN) == 0) { | ||
219 | selected = iface; | 217 | selected = iface; |
220 | break; | 218 | break; |
221 | } | 219 | } |
@@ -1085,7 +1083,7 @@ int prism2_sta_deauth(local_info_t *local, u16 reason) | |||
1085 | 1083 | ||
1086 | if (local->iw_mode != IW_MODE_INFRA || | 1084 | if (local->iw_mode != IW_MODE_INFRA || |
1087 | is_zero_ether_addr(local->bssid) || | 1085 | is_zero_ether_addr(local->bssid) || |
1088 | memcmp(local->bssid, "\x44\x44\x44\x44\x44\x44", ETH_ALEN) == 0) | 1086 | ether_addr_equal(local->bssid, "\x44\x44\x44\x44\x44\x44")) |
1089 | return 0; | 1087 | return 0; |
1090 | 1088 | ||
1091 | ret = prism2_sta_send_mgmt(local, local->bssid, IEEE80211_STYPE_DEAUTH, | 1089 | ret = prism2_sta_send_mgmt(local, local->bssid, IEEE80211_STYPE_DEAUTH, |