1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-12-26 11:47:31 +00:00

The bssid can change from underneath us, so take a reference before

we fiddle with it.
This commit is contained in:
Adrian Chadd 2013-11-26 01:30:10 +00:00
parent bb39ffb8c9
commit 39bb444c76
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=258612

View File

@ -945,10 +945,13 @@ iwi_media_status(struct ifnet *ifp, struct ifmediareq *imr)
struct ieee80211vap *vap = ifp->if_softc; struct ieee80211vap *vap = ifp->if_softc;
struct ieee80211com *ic = vap->iv_ic; struct ieee80211com *ic = vap->iv_ic;
struct iwi_softc *sc = ic->ic_ifp->if_softc; struct iwi_softc *sc = ic->ic_ifp->if_softc;
struct ieee80211_node *ni;
/* read current transmission rate from adapter */ /* read current transmission rate from adapter */
vap->iv_bss->ni_txrate = ni = ieee80211_ref_node(vap->iv_bss);
ni->ni_txrate =
iwi_cvtrate(CSR_READ_4(sc, IWI_CSR_CURRENT_TX_RATE)); iwi_cvtrate(CSR_READ_4(sc, IWI_CSR_CURRENT_TX_RATE));
ieee80211_free_node(ni);
ieee80211_media_status(ifp, imr); ieee80211_media_status(ifp, imr);
} }
@ -1367,13 +1370,14 @@ iwi_checkforqos(struct ieee80211vap *vap,
frm += frm[1] + 2; frm += frm[1] + 2;
} }
ni = vap->iv_bss; ni = ieee80211_ref_node(vap->iv_bss);
ni->ni_capinfo = capinfo; ni->ni_capinfo = capinfo;
ni->ni_associd = associd & 0x3fff; ni->ni_associd = associd & 0x3fff;
if (wme != NULL) if (wme != NULL)
ni->ni_flags |= IEEE80211_NODE_QOS; ni->ni_flags |= IEEE80211_NODE_QOS;
else else
ni->ni_flags &= ~IEEE80211_NODE_QOS; ni->ni_flags &= ~IEEE80211_NODE_QOS;
ieee80211_free_node(ni);
#undef SUBTYPE #undef SUBTYPE
} }
@ -2812,7 +2816,7 @@ iwi_auth_and_assoc(struct iwi_softc *sc, struct ieee80211vap *vap)
{ {
struct ieee80211com *ic = vap->iv_ic; struct ieee80211com *ic = vap->iv_ic;
struct ifnet *ifp = vap->iv_ifp; struct ifnet *ifp = vap->iv_ifp;
struct ieee80211_node *ni = vap->iv_bss; struct ieee80211_node *ni;
struct iwi_configuration config; struct iwi_configuration config;
struct iwi_associate *assoc = &sc->assoc; struct iwi_associate *assoc = &sc->assoc;
struct iwi_rateset rs; struct iwi_rateset rs;
@ -2822,6 +2826,8 @@ iwi_auth_and_assoc(struct iwi_softc *sc, struct ieee80211vap *vap)
IWI_LOCK_ASSERT(sc); IWI_LOCK_ASSERT(sc);
ni = ieee80211_ref_node(vap->iv_bss);
if (sc->flags & IWI_FLAG_ASSOCIATED) { if (sc->flags & IWI_FLAG_ASSOCIATED) {
DPRINTF(("Already associated\n")); DPRINTF(("Already associated\n"));
return (-1); return (-1);
@ -2980,6 +2986,7 @@ iwi_auth_and_assoc(struct iwi_softc *sc, struct ieee80211vap *vap)
le16toh(assoc->intval))); le16toh(assoc->intval)));
error = iwi_cmd(sc, IWI_CMD_ASSOCIATE, assoc, sizeof *assoc); error = iwi_cmd(sc, IWI_CMD_ASSOCIATE, assoc, sizeof *assoc);
done: done:
ieee80211_free_node(ni);
if (error) if (error)
IWI_STATE_END(sc, IWI_FW_ASSOCIATING); IWI_STATE_END(sc, IWI_FW_ASSOCIATING);