diff options
author | Sam Leffler <sam@FreeBSD.org> | 2008-05-28 23:32:00 +0000 |
---|---|---|
committer | Sam Leffler <sam@FreeBSD.org> | 2008-05-28 23:32:00 +0000 |
commit | 71fe06ca7fdce77d46a6fa6fc7d94a5c498a3e77 (patch) | |
tree | 11f1e7429f40b4646c19d38f606412f9c2290a86 /sys/net80211/ieee80211_ioctl.c | |
parent | 5c1f7f19b67464b7966fb2745b1f6c03c81d47a2 (diff) | |
download | src-71fe06ca7fdce77d46a6fa6fc7d94a5c498a3e77.tar.gz src-71fe06ca7fdce77d46a6fa6fc7d94a5c498a3e77.zip |
Add a mac address to the key definition as otherwise we lose the
address specified in the ioctl and for drivers that need the address
to locate a key (e.g. for delete).
Note this changes net80211-private api's but not the driver callback;
may want to change that in the future.
Reviewed by: sephe, thompsa
Notes
Notes:
svn path=/head/; revision=179395
Diffstat (limited to 'sys/net80211/ieee80211_ioctl.c')
-rw-r--r-- | sys/net80211/ieee80211_ioctl.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/sys/net80211/ieee80211_ioctl.c b/sys/net80211/ieee80211_ioctl.c index d9c1857b485f..786c81568dbd 100644 --- a/sys/net80211/ieee80211_ioctl.c +++ b/sys/net80211/ieee80211_ioctl.c @@ -1135,8 +1135,9 @@ ieee80211_ioctl_setkey(struct ieee80211vap *vap, struct ieee80211req *ireq) wk->wk_keytsc = 0; /* new key, reset */ memset(wk->wk_key, 0, sizeof(wk->wk_key)); memcpy(wk->wk_key, ik.ik_keydata, ik.ik_keylen); - if (!ieee80211_crypto_setkey(vap, wk, - ni != NULL ? ni->ni_macaddr : ik.ik_macaddr)) + IEEE80211_ADDR_COPY(wk->wk_macaddr, + ni != NULL ? ni->ni_macaddr : ik.ik_macaddr); + if (!ieee80211_crypto_setkey(vap, wk)) error = EIO; else if ((ik.ik_flags & IEEE80211_KEY_DEFAULT)) vap->iv_def_txkey = kid; @@ -2502,7 +2503,8 @@ ieee80211_ioctl_set80211(struct ieee80211vap *vap, u_long cmd, struct ieee80211r IEEE80211_KEY_XMIT | IEEE80211_KEY_RECV, k)) { k->wk_keylen = ireq->i_len; memcpy(k->wk_key, tmpkey, sizeof(tmpkey)); - if (!ieee80211_crypto_setkey(vap, k, vap->iv_myaddr)) + IEEE80211_ADDR_COPY(k->wk_macaddr, vap->iv_myaddr); + if (!ieee80211_crypto_setkey(vap, k)) error = EINVAL; } else error = EINVAL; |