Fix ucastkey teardown for drivers that plumb clear keys or similar

(e.g. ath): we must check the key index and not whether the key
points at a cipher other than "undef".  This looks like it's been
broken for a while.  Might be worth adding an explicit clear cipher
at some point though this would require changes to the usage of
IEEE80211_KEY_UNDEFINED.

PR:		125906
This commit is contained in:
Sam Leffler 2008-12-15 22:50:50 +00:00
parent 7946271527
commit ca92652af7

View File

@ -1643,7 +1643,7 @@ ieee80211_node_delucastkey(struct ieee80211_node *ni)
IEEE80211_NODE_LOCK(nt);
nikey = NULL;
status = 1; /* NB: success */
if (!IEEE80211_KEY_UNDEFINED(&ni->ni_ucastkey)) {
if (ni->ni_ucastkey.wk_keyix != IEEE80211_KEYIX_NONE) {
keyix = ni->ni_ucastkey.wk_rxkeyix;
status = ieee80211_crypto_delkey(ni->ni_vap, &ni->ni_ucastkey);
if (nt->nt_keyixmap != NULL && keyix < nt->nt_keyixmax) {