Skip to content

Commit

Permalink
mac80211: better fix for conn_mon_timer running after disassociate
Browse files Browse the repository at this point in the history
Is still possible to schedule conn_mon_timer after disassociate from
ieee80211_sta_tx_notify() and ieee80211_offchannel_ps_disable().

Move disassociate check to ieee80211_sta_reset_conn_monitor() to cover
all these cases, and add unlikely since in most the time we call
ieee80211_sta_reset_conn_monitor() when associated.

Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
  • Loading branch information
Stanislaw Gruszka authored and John W. Linville committed Feb 25, 2011
1 parent 08f6c85 commit 8628172
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions net/mac80211/mlme.c
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,9 @@ void ieee80211_sta_reset_conn_monitor(struct ieee80211_sub_if_data *sdata)
{
struct ieee80211_if_managed *ifmgd = &sdata->u.mgd;

if (unlikely(!sdata->u.mgd.associated))
return;

if (sdata->local->hw.flags & IEEE80211_HW_CONNECTION_MONITOR)
return;

Expand Down Expand Up @@ -1083,12 +1086,6 @@ void ieee80211_sta_rx_notify(struct ieee80211_sub_if_data *sdata,
if (is_multicast_ether_addr(hdr->addr1))
return;

/*
* In case we receive frames after disassociation.
*/
if (!sdata->u.mgd.associated)
return;

ieee80211_sta_reset_conn_monitor(sdata);
}

Expand Down

0 comments on commit 8628172

Please sign in to comment.