diff --git a/sys/net80211/ieee80211_proto.c b/sys/net80211/ieee80211_proto.c index 8977f018810d..9b0da8089ed5 100644 --- a/sys/net80211/ieee80211_proto.c +++ b/sys/net80211/ieee80211_proto.c @@ -940,7 +940,8 @@ ieee80211_newstate(struct ieee80211com *ic, enum ieee80211_state nstate, int arg ni->ni_fails++; ieee80211_unref_node(&ni); } - ieee80211_begin_scan(ic, arg); + if (ic->ic_roaming == IEEE80211_ROAMING_AUTO) + ieee80211_begin_scan(ic, arg); break; } break; @@ -972,10 +973,12 @@ ieee80211_newstate(struct ieee80211com *ic, enum ieee80211_state nstate, int arg ic->ic_state = ostate; /* stay RUN */ break; case IEEE80211_FC0_SUBTYPE_DEAUTH: - /* try to reauth */ - IEEE80211_SEND_MGMT(ic, ni, - IEEE80211_FC0_SUBTYPE_AUTH, 1); ieee80211_sta_leave(ic, ni); + if (ic->ic_roaming == IEEE80211_ROAMING_AUTO) { + /* try to reauth */ + IEEE80211_SEND_MGMT(ic, ni, + IEEE80211_FC0_SUBTYPE_AUTH, 1); + } break; } break; @@ -994,9 +997,11 @@ ieee80211_newstate(struct ieee80211com *ic, enum ieee80211_state nstate, int arg IEEE80211_FC0_SUBTYPE_ASSOC_REQ, 0); break; case IEEE80211_S_RUN: - IEEE80211_SEND_MGMT(ic, ni, - IEEE80211_FC0_SUBTYPE_ASSOC_REQ, 1); ieee80211_sta_leave(ic, ni); + if (ic->ic_roaming == IEEE80211_ROAMING_AUTO) { + IEEE80211_SEND_MGMT(ic, ni, + IEEE80211_FC0_SUBTYPE_ASSOC_REQ, 1); + } break; } break;