diff options
author | Reyk Floeter <reyk@cvs.openbsd.org> | 2005-03-13 18:32:22 +0000 |
---|---|---|
committer | Reyk Floeter <reyk@cvs.openbsd.org> | 2005-03-13 18:32:22 +0000 |
commit | 3f052ef3c7357e0ac7dd5622dc4a6025eb6fb782 (patch) | |
tree | 4281334f73c98dcb460f19e9b3d676c66b02beda /sys | |
parent | 289995ba3cce596d3164c944c44fb1539f6dad0f (diff) |
the wep mac may be NULL if it's a broadcast key
ok krw@
Diffstat (limited to 'sys')
-rw-r--r-- | sys/dev/ic/ar5211.c | 11 | ||||
-rw-r--r-- | sys/dev/ic/ar5212.c | 11 |
2 files changed, 14 insertions, 8 deletions
diff --git a/sys/dev/ic/ar5211.c b/sys/dev/ic/ar5211.c index a4840457557..8a1e9429386 100644 --- a/sys/dev/ic/ar5211.c +++ b/sys/dev/ic/ar5211.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ar5211.c,v 1.3 2005/03/10 08:30:56 reyk Exp $ */ +/* $OpenBSD: ar5211.c,v 1.4 2005/03/13 18:32:21 reyk Exp $ */ /* * Copyright (c) 2004, 2005 Reyk Floeter <reyk@vantronix.net> @@ -2028,10 +2028,13 @@ ar5k_ar5211_setKeyCacheEntryMac(hal, entry, mac) AR5K_ASSERT_ENTRY(entry, AR5K_AR5211_KEYTABLE_SIZE); offset = AR5K_AR5211_KEYCACHE_SIZE - 2; + low_id = high_id = 0; - /* XXX big endian problems? */ - bcopy(mac, &low_id, 4); - bcopy(mac + 4, &high_id, 2); + /* MAC may be NULL if it's a broadcast key */ + if (mac != NULL) { + bcopy(mac, &low_id, 4); + bcopy(mac + 4, &high_id, 2); + } high_id = 0x0000ffff & htole32(high_id); diff --git a/sys/dev/ic/ar5212.c b/sys/dev/ic/ar5212.c index 57136196f1e..a8a0e9da7d5 100644 --- a/sys/dev/ic/ar5212.c +++ b/sys/dev/ic/ar5212.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ar5212.c,v 1.5 2005/03/10 08:30:56 reyk Exp $ */ +/* $OpenBSD: ar5212.c,v 1.6 2005/03/13 18:32:21 reyk Exp $ */ /* * Copyright (c) 2004, 2005 Reyk Floeter <reyk@vantronix.net> @@ -2228,10 +2228,13 @@ ar5k_ar5212_setKeyCacheEntryMac(hal, entry, mac) AR5K_ASSERT_ENTRY(entry, AR5K_AR5212_KEYTABLE_SIZE); offset = AR5K_AR5212_KEYCACHE_SIZE - 2; + low_id = high_id = 0; - /* XXX big endian problems? */ - bcopy(mac, &low_id, 4); - bcopy(mac + 4, &high_id, 2); + /* MAC may be NULL if it's a broadcast key */ + if (mac != NULL) { + bcopy(mac, &low_id, 4); + bcopy(mac + 4, &high_id, 2); + } high_id = 0x0000ffff & htole32(high_id); |