summaryrefslogtreecommitdiff
path: root/sys/dev/ic/ar5211.c
diff options
context:
space:
mode:
authorReyk Floeter <reyk@cvs.openbsd.org>2005-03-13 18:32:22 +0000
committerReyk Floeter <reyk@cvs.openbsd.org>2005-03-13 18:32:22 +0000
commit3f052ef3c7357e0ac7dd5622dc4a6025eb6fb782 (patch)
tree4281334f73c98dcb460f19e9b3d676c66b02beda /sys/dev/ic/ar5211.c
parent289995ba3cce596d3164c944c44fb1539f6dad0f (diff)
the wep mac may be NULL if it's a broadcast key
ok krw@
Diffstat (limited to 'sys/dev/ic/ar5211.c')
-rw-r--r--sys/dev/ic/ar5211.c11
1 files changed, 7 insertions, 4 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);