提交 3cf20931 编写于 作者: D Dan Williams 提交者: John W. Linville

[PATCH] libertas: use compare_ether_addr() rather than memcmp() where appropriate

Signed-off-by: NDan Williams <dcbw@redhat.com>
Signed-off-by: NJohn W. Linville <linville@tuxdriver.com>
上级 02eb229b
...@@ -2,6 +2,7 @@ ...@@ -2,6 +2,7 @@
#include <linux/bitops.h> #include <linux/bitops.h>
#include <net/ieee80211.h> #include <net/ieee80211.h>
#include <linux/etherdevice.h>
#include "assoc.h" #include "assoc.h"
#include "join.h" #include "join.h"
...@@ -161,8 +162,8 @@ static int assoc_helper_associate(wlan_private *priv, ...@@ -161,8 +162,8 @@ static int assoc_helper_associate(wlan_private *priv,
/* If we're given and 'any' BSSID, try associating based on SSID */ /* If we're given and 'any' BSSID, try associating based on SSID */
if (test_bit(ASSOC_FLAG_BSSID, &assoc_req->flags)) { if (test_bit(ASSOC_FLAG_BSSID, &assoc_req->flags)) {
if (memcmp(bssid_any, assoc_req->bssid, ETH_ALEN) if (compare_ether_addr(bssid_any, assoc_req->bssid)
&& memcmp(bssid_off, assoc_req->bssid, ETH_ALEN)) { && compare_ether_addr(bssid_off, assoc_req->bssid)) {
ret = assoc_helper_bssid(priv, assoc_req); ret = assoc_helper_bssid(priv, assoc_req);
done = 1; done = 1;
if (ret) { if (ret) {
...@@ -488,8 +489,8 @@ void libertas_association_worker(struct work_struct *work) ...@@ -488,8 +489,8 @@ void libertas_association_worker(struct work_struct *work)
/* But don't use 'any' SSID if there's a valid locked BSSID to use */ /* But don't use 'any' SSID if there's a valid locked BSSID to use */
if (test_bit(ASSOC_FLAG_BSSID, &assoc_req->flags)) { if (test_bit(ASSOC_FLAG_BSSID, &assoc_req->flags)) {
if (memcmp(&assoc_req->bssid, bssid_any, ETH_ALEN) if (compare_ether_addr(assoc_req->bssid, bssid_any)
&& memcmp(&assoc_req->bssid, bssid_off, ETH_ALEN)) && compare_ether_addr(assoc_req->bssid, bssid_off))
find_any_ssid = 0; find_any_ssid = 0;
} }
......
...@@ -1238,7 +1238,7 @@ struct bss_descriptor * libertas_find_BSSID_in_list(wlan_adapter * adapter, ...@@ -1238,7 +1238,7 @@ struct bss_descriptor * libertas_find_BSSID_in_list(wlan_adapter * adapter,
*/ */
mutex_lock(&adapter->lock); mutex_lock(&adapter->lock);
list_for_each_entry (iter_bss, &adapter->network_list, list) { list_for_each_entry (iter_bss, &adapter->network_list, list) {
if (memcmp(iter_bss->bssid, bssid, ETH_ALEN)) if (compare_ether_addr(iter_bss->bssid, bssid))
continue; /* bssid doesn't match */ continue; /* bssid doesn't match */
switch (mode) { switch (mode) {
case IW_MODE_INFRA: case IW_MODE_INFRA:
...@@ -1284,7 +1284,7 @@ struct bss_descriptor * libertas_find_SSID_in_list(wlan_adapter * adapter, ...@@ -1284,7 +1284,7 @@ struct bss_descriptor * libertas_find_SSID_in_list(wlan_adapter * adapter,
if (libertas_SSID_cmp(&iter_bss->ssid, ssid) != 0) if (libertas_SSID_cmp(&iter_bss->ssid, ssid) != 0)
continue; /* ssid doesn't match */ continue; /* ssid doesn't match */
if (bssid && memcmp(iter_bss->bssid, bssid, ETH_ALEN) != 0) if (bssid && compare_ether_addr(iter_bss->bssid, bssid) != 0)
continue; /* bssid doesn't match */ continue; /* bssid doesn't match */
switch (mode) { switch (mode) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册