diff --git a/sys/net80211/ieee80211_ioctl.c b/sys/net80211/ieee80211_ioctl.c index 5ef51d70dd87..363b19420040 100644 --- a/sys/net80211/ieee80211_ioctl.c +++ b/sys/net80211/ieee80211_ioctl.c @@ -1728,6 +1728,12 @@ ieee80211_ioctl_setkey(struct ieee80211com *ic, struct ieee80211req *ireq) if (kid >= IEEE80211_WEP_NKID) return EINVAL; wk = &ic->ic_nw_keys[kid]; + /* + * Global slots start off w/o any assigned key index. + * Force one here for consistency with IEEE80211_IOC_WEPKEY. + */ + if (wk->wk_keyix == IEEE80211_KEYIX_NONE) + wk->wk_keyix = kid; ni = NULL; } error = 0;