Skip to content

Commit c07981a

Browse files
Miriam-Racheljmberg-intel
authored andcommitted
wifi: mac80211: add the virtual monitor after reconfig complete
In reconfig we add the virtual monitor in 2 cases: 1. If we are resuming (it was deleted on suspend) 2. If it was added after an error but before the reconfig (due to the last non-monitor interface removal). In the second case, the removal of the non-monitor interface will succeed but the addition of the virtual monitor will fail, so we add it in the reconfig. The problem is that we mislead the driver to think that this is an existing interface that is getting re-added - while it is actually a completely new interface from the drivers' point of view. Some drivers act differently when a interface is re-added. For example, it might not initialize things because they were already initialized. Such drivers will - in this case - be left with a partialy initialized vif. To fix it, add the virtual monitor after reconfig_complete, so the driver will know that this is a completely new interface. Fixes: 3c3e21e ("mac80211: destroy virtual monitor interface across suspend") Reviewed-by: Johannes Berg <[email protected]> Signed-off-by: Miri Korenblit <[email protected]> Link: https://patch.msgid.link/20250709233451.648d39b041e8.I2e37b68375278987e303d6c00cc5f3d8334d2f96@changeid Signed-off-by: Johannes Berg <[email protected]>
1 parent d7a54d0 commit c07981a

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

net/mac80211/util.c

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2144,11 +2144,6 @@ int ieee80211_reconfig(struct ieee80211_local *local)
21442144
cfg80211_sched_scan_stopped_locked(local->hw.wiphy, 0);
21452145

21462146
wake_up:
2147-
2148-
if (local->virt_monitors > 0 &&
2149-
local->virt_monitors == local->open_count)
2150-
ieee80211_add_virtual_monitor(local);
2151-
21522147
/*
21532148
* Clear the WLAN_STA_BLOCK_BA flag so new aggregation
21542149
* sessions can be established after a resume.
@@ -2202,6 +2197,10 @@ int ieee80211_reconfig(struct ieee80211_local *local)
22022197
}
22032198
}
22042199

2200+
if (local->virt_monitors > 0 &&
2201+
local->virt_monitors == local->open_count)
2202+
ieee80211_add_virtual_monitor(local);
2203+
22052204
if (!suspended)
22062205
return 0;
22072206

0 commit comments

Comments
 (0)