aboutsummaryrefslogtreecommitdiffstats
path: root/src/rsn_supp
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 /src/rsn_supp
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 'src/rsn_supp')
-rw-r--r--src/rsn_supp/preauth.c3
-rw-r--r--src/rsn_supp/wpa.c3
2 files changed, 2 insertions, 4 deletions
diff --git a/src/rsn_supp/preauth.c b/src/rsn_supp/preauth.c
index e9bf7c6..7bc3c04 100644
--- a/src/rsn_supp/preauth.c
+++ b/src/rsn_supp/preauth.c
@@ -68,8 +68,7 @@ static void rsn_preauth_receive(void *ctx, const u8 *src_addr,
wpa_hexdump(MSG_MSGDUMP, "RX pre-auth", buf, len);
if (sm->preauth_eapol == NULL ||
- os_memcmp(sm->preauth_bssid, "\x00\x00\x00\x00\x00\x00",
- ETH_ALEN) == 0 ||
+ is_zero_ether_addr(sm->preauth_bssid) ||
os_memcmp(sm->preauth_bssid, src_addr, ETH_ALEN) != 0) {
wpa_printf(MSG_WARNING, "RSN pre-auth frame received from "
"unexpected source " MACSTR " - dropped",
diff --git a/src/rsn_supp/wpa.c b/src/rsn_supp/wpa.c
index 1dada92..cb511e0 100644
--- a/src/rsn_supp/wpa.c
+++ b/src/rsn_supp/wpa.c
@@ -98,8 +98,7 @@ void wpa_eapol_key_send(struct wpa_sm *sm, const u8 *kck,
int ver, const u8 *dest, u16 proto,
u8 *msg, size_t msg_len, u8 *key_mic)
{
- if (os_memcmp(dest, "\x00\x00\x00\x00\x00\x00", ETH_ALEN) == 0 &&
- os_memcmp(sm->bssid, "\x00\x00\x00\x00\x00\x00", ETH_ALEN) == 0) {
+ if (is_zero_ether_addr(dest) && is_zero_ether_addr(sm->bssid)) {
/*
* Association event was not yet received; try to fetch
* BSSID from the driver.