aboutsummaryrefslogtreecommitdiffstats
path: root/wpa_supplicant/wpa_supplicant.c
diff options
context:
space:
mode:
authorJouni Malinen <j@w1.fi>2008-06-03 15:08:48 (GMT)
committerJouni Malinen <j@w1.fi>2008-06-03 15:08:48 (GMT)
commita8e16edc8638d18b972e2b053d17b54167ce5aa5 (patch)
tree263bc8ddfe1b80a718d1f41ccc43d72e9569947b /wpa_supplicant/wpa_supplicant.c
parent957ed801e9261c051c2ca1bbc5a051ff38e11fde (diff)
downloadhostap-06-a8e16edc8638d18b972e2b053d17b54167ce5aa5.zip
hostap-06-a8e16edc8638d18b972e2b053d17b54167ce5aa5.tar.gz
hostap-06-a8e16edc8638d18b972e2b053d17b54167ce5aa5.tar.bz2
Introduced new helper function is_zero_ether_addr()
Use this inline function to replace os_memcmp(addr, "\x00\x00\x00\x00\x00\x00", ETH_ALEN) == 0.
Diffstat (limited to 'wpa_supplicant/wpa_supplicant.c')
-rw-r--r--wpa_supplicant/wpa_supplicant.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/wpa_supplicant/wpa_supplicant.c b/wpa_supplicant/wpa_supplicant.c
index 9bd5435..5487212 100644
--- a/wpa_supplicant/wpa_supplicant.c
+++ b/wpa_supplicant/wpa_supplicant.c
@@ -187,7 +187,7 @@ static void wpa_supplicant_timeout(void *eloop_ctx, void *timeout_ctx)
{
struct wpa_supplicant *wpa_s = eloop_ctx;
const u8 *bssid = wpa_s->bssid;
- if (os_memcmp(bssid, "\x00\x00\x00\x00\x00\x00", ETH_ALEN) == 0)
+ if (is_zero_ether_addr(bssid))
bssid = wpa_s->pending_bssid;
wpa_msg(wpa_s, MSG_INFO, "Authentication with " MACSTR " timed out.",
MAC2STR(bssid));
@@ -1131,8 +1131,7 @@ void wpa_supplicant_disassociate(struct wpa_supplicant *wpa_s,
int reason_code)
{
u8 *addr = NULL;
- if (os_memcmp(wpa_s->bssid, "\x00\x00\x00\x00\x00\x00", ETH_ALEN) != 0)
- {
+ if (!is_zero_ether_addr(wpa_s->bssid)) {
if (wpa_s->use_client_mlme)
ieee80211_sta_disassociate(wpa_s, reason_code);
else
@@ -1160,8 +1159,7 @@ void wpa_supplicant_deauthenticate(struct wpa_supplicant *wpa_s,
{
u8 *addr = NULL;
wpa_supplicant_set_state(wpa_s, WPA_DISCONNECTED);
- if (os_memcmp(wpa_s->bssid, "\x00\x00\x00\x00\x00\x00", ETH_ALEN) != 0)
- {
+ if (!is_zero_ether_addr(wpa_s->bssid)) {
if (wpa_s->use_client_mlme)
ieee80211_sta_deauthenticate(wpa_s, reason_code);
else