Index: net80211/ieee80211_node.c =================================================================== --- net80211/ieee80211_node.c (revision 3345) +++ net80211/ieee80211_node.c (working copy) @@ -1505,8 +1505,10 @@ if (ic->ic_newassoc != NULL) ic->ic_newassoc(ni, 1); + /* XXX not right for 802.1x/WPA */ ieee80211_node_authorize(ni); + ieee80211_notify_node_join(ni, 1); if (vap->iv_opmode == IEEE80211_M_AHDEMO) { /* * Blindly propagate capabilities based on the @@ -2309,8 +2311,8 @@ * is reused before the reference count goes to zero * (and memory is reclaimed). */ +done: ieee80211_sta_leave(ni); -done: /* Run a cleanup */ #ifdef IEEE80211_DEBUG_REFCNT ic->ic_node_cleanup_debug(ni, __func__, __LINE__); Index: net80211/ieee80211_beacon.c =================================================================== --- net80211/ieee80211_beacon.c (revision 3345) +++ net80211/ieee80211_beacon.c (working copy) @@ -159,8 +159,13 @@ } /* WPA 1+2 */ - if (vap->iv_flags & IEEE80211_F_WPA) - frm = ieee80211_add_wpa(frm, vap); + if (vap->iv_opt_ie != NULL) { + memcpy(frm, vap->iv_opt_ie, vap->iv_opt_ie_len); + frm += vap->iv_opt_ie_len; + } else { + if (vap->iv_flags & IEEE80211_F_WPA) + frm = ieee80211_add_wpa(frm, vap); + } /* athAdvCaps */ bo->bo_ath_caps = frm; Index: net80211/ieee80211_wireless.c =================================================================== --- net80211/ieee80211_wireless.c (revision 3345) +++ net80211/ieee80211_wireless.c (working copy) @@ -3248,7 +3248,7 @@ * without being able to intervene when processing * association response frames--so disallow it for now. */ - if (vap->iv_opmode != IEEE80211_M_STA) + if (vap->iv_opmode != IEEE80211_M_STA && vap->iv_opmode != IEEE80211_M_IBSS) return -EOPNOTSUPP; if (!is_valid_ie_list(wri->length, extra, 0)) return -EINVAL; @@ -3266,6 +3266,8 @@ if (vap->iv_xrvap && !(vap->iv_flags & IEEE80211_F_XR)) ieee80211_ioctl_setoptie(vap->iv_xrvap->iv_dev, info, wri, extra); #endif + if (vap->iv_opmode == IEEE80211_M_IBSS) + ieee80211_open(vap->iv_dev); return 0; }