net80211: use IEEE80211_KEY_UNDEFINED() insetad of checking they keyix

For ieee80211_node_delucastkey() rather than checking the keyix to be
IEEE80211_KEYIX_NONE use the IEEE80211_KEY_UNDEFINED() macro (which
chekes the wk_cipher to be 'none').

Sponsored by:	The FreeBSD Foundation
MFC after:	3 days
Reviewed by:	adrian
Differential Revision: https://reviews.freebsd.org/D48980
This commit is contained in:
Bjoern A. Zeeb 2025-02-15 12:40:46 +00:00
parent d688c20395
commit 9763fec11b

View file

@ -2209,7 +2209,7 @@ ieee80211_node_delucastkey(struct ieee80211_node *ni)
IEEE80211_NODE_LOCK(nt);
nikey = NULL;
status = 1; /* NB: success */
if (ni->ni_ucastkey.wk_keyix != IEEE80211_KEYIX_NONE) {
if (IEEE80211_KEY_UNDEFINED(&ni->ni_ucastkey)) {
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) {