Skip to content

Commit

Permalink
mac80211: clear timer bits when disconnecting
Browse files Browse the repository at this point in the history
There's a corner case that can happen when we
suspend with a timer running, then resume and
disconnect. If we connect again, suspend and
resume we might start timers that shouldn't be
running. Reset the timer flags to avoid this.

This affects both mesh and managed modes.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
  • Loading branch information
Johannes Berg committed Aug 1, 2012
1 parent ba846a5 commit 2d9957c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
2 changes: 2 additions & 0 deletions net/mac80211/mesh.c
Original file line number Diff line number Diff line change
Expand Up @@ -634,6 +634,8 @@ void ieee80211_stop_mesh(struct ieee80211_sub_if_data *sdata)
local->fif_other_bss--;
atomic_dec(&local->iff_allmultis);
ieee80211_configure_filter(local);

sdata->u.mesh.timers_running = 0;
}

static void ieee80211_mesh_rx_bcn_presp(struct ieee80211_sub_if_data *sdata,
Expand Down
2 changes: 2 additions & 0 deletions net/mac80211/mlme.c
Original file line number Diff line number Diff line change
Expand Up @@ -1430,6 +1430,8 @@ static void ieee80211_set_disassoc(struct ieee80211_sub_if_data *sdata,
del_timer_sync(&sdata->u.mgd.bcn_mon_timer);
del_timer_sync(&sdata->u.mgd.timer);
del_timer_sync(&sdata->u.mgd.chswitch_timer);

sdata->u.mgd.timers_running = 0;
}

void ieee80211_sta_rx_notify(struct ieee80211_sub_if_data *sdata,
Expand Down

0 comments on commit 2d9957c

Please sign in to comment.