Commit 88bc40e8c3d3bca7d26c756bb0b823d4abad3355
Committed by
Johannes Berg
1 parent
14cdf11201
Exists in
smarc-l5.0.0_1.0.0-ga
and in
5 other branches
mac80211: go out of PS before sending disassoc
on disassoc, ieee80211_set_disassoc() goes out of PS before indicating BSS_CHANGED_ASSOC (not sure why this is needed, but some drivers might count on the current behavior). However, it does it after sending the disassoc frame, which results in null-data frame being sent (in order to go out of ps) after we were already sent the disassoc, which is invalid. Fix it by going out of ps before sending the disassoc. Signed-off-by: Eliad Peller <eliad@wizery.com> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Showing 1 changed file with 11 additions and 6 deletions Side-by-side Diff
net/mac80211/mlme.c
... | ... | @@ -1364,6 +1364,17 @@ |
1364 | 1364 | } |
1365 | 1365 | mutex_unlock(&local->sta_mtx); |
1366 | 1366 | |
1367 | + /* | |
1368 | + * if we want to get out of ps before disassoc (why?) we have | |
1369 | + * to do it before sending disassoc, as otherwise the null-packet | |
1370 | + * won't be valid. | |
1371 | + */ | |
1372 | + if (local->hw.conf.flags & IEEE80211_CONF_PS) { | |
1373 | + local->hw.conf.flags &= ~IEEE80211_CONF_PS; | |
1374 | + ieee80211_hw_config(local, IEEE80211_CONF_CHANGE_PS); | |
1375 | + } | |
1376 | + local->ps_sdata = NULL; | |
1377 | + | |
1367 | 1378 | /* flush out any pending frame (e.g. DELBA) before deauth/disassoc */ |
1368 | 1379 | if (tx) |
1369 | 1380 | drv_flush(local, false); |
... | ... | @@ -1395,12 +1406,6 @@ |
1395 | 1406 | |
1396 | 1407 | del_timer_sync(&local->dynamic_ps_timer); |
1397 | 1408 | cancel_work_sync(&local->dynamic_ps_enable_work); |
1398 | - | |
1399 | - if (local->hw.conf.flags & IEEE80211_CONF_PS) { | |
1400 | - local->hw.conf.flags &= ~IEEE80211_CONF_PS; | |
1401 | - ieee80211_hw_config(local, IEEE80211_CONF_CHANGE_PS); | |
1402 | - } | |
1403 | - local->ps_sdata = NULL; | |
1404 | 1409 | |
1405 | 1410 | /* Disable ARP filtering */ |
1406 | 1411 | if (sdata->vif.bss_conf.arp_filter_enabled) { |