aboutsummaryrefslogtreecommitdiffstats
path: root/src/drivers/driver_bsd.c
diff options
context:
space:
mode:
authorJouni Malinen <j@w1.fi>2011-01-09 17:44:28 (GMT)
committerJouni Malinen <j@w1.fi>2011-01-09 17:44:28 (GMT)
commit0382097ef3530497950c53cb5bb1866cbbe82b7b (patch)
tree218c230ed7f895e265c6e4345647b8302495439b /src/drivers/driver_bsd.c
parent8546ea19301f31e5faf58a0f154773c3123e6474 (diff)
downloadhostap-0382097ef3530497950c53cb5bb1866cbbe82b7b.zip
hostap-0382097ef3530497950c53cb5bb1866cbbe82b7b.tar.gz
hostap-0382097ef3530497950c53cb5bb1866cbbe82b7b.tar.bz2
Use set_key addr to distinguish default and multicast keys
Previously, both NULL and ff:ff:ff:ff:ff:ff addr were used in various places to indicate default/broadcast keys. Make this more consistent and useful by defining NULL to mean default key (i.e., used both for unicast and broadcast) and ff:ff:ff:ff:ff:ff to indicate broadcast key (i.e., used only with broadcast).
Diffstat (limited to 'src/drivers/driver_bsd.c')
-rw-r--r--src/drivers/driver_bsd.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/src/drivers/driver_bsd.c b/src/drivers/driver_bsd.c
index c9520ec..d57d218 100644
--- a/src/drivers/driver_bsd.c
+++ b/src/drivers/driver_bsd.c
@@ -296,9 +296,7 @@ bsd_set_key(const char *ifname, void *priv, enum wpa_alg alg,
if (alg == WPA_ALG_NONE) {
#ifndef HOSTAPD
- if (addr == NULL ||
- os_memcmp(addr, "\xff\xff\xff\xff\xff\xff",
- IEEE80211_ADDR_LEN) == 0)
+ if (addr == NULL || is_broadcast_ether_addr(addr))
return bsd_del_key(priv, NULL, key_idx);
else
#endif /* HOSTAPD */
@@ -335,8 +333,7 @@ bsd_set_key(const char *ifname, void *priv, enum wpa_alg alg,
* the address (yech). Note also that we can only mark global
* keys default; doing this for a unicast key is an error.
*/
- if (os_memcmp(addr, "\xff\xff\xff\xff\xff\xff",
- IEEE80211_ADDR_LEN) == 0) {
+ if (is_broadcast_ether_addr(addr)) {
wk.ik_flags |= IEEE80211_KEY_GROUP;
wk.ik_keyix = key_idx;
} else {