mac80211: fix drv_config_iface_filter() behaviour
authorJohannes Berg <johannes.berg@intel.com>
Fri, 17 Apr 2020 09:18:31 +0000 (11:18 +0200)
committerJohannes Berg <johannes.berg@intel.com>
Fri, 24 Apr 2020 09:46:17 +0000 (11:46 +0200)
There are two bugs with this, first, it shouldn't be called
on an interface that's down, and secondly, it should then be
called when the interface comes up.

Note that the currently only user (iwlwifi) doesn't seem to
care about either of these scenarios.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Link: https://lore.kernel.org/r/20200417111830.401d82c7a0bf.I5dc7d718816460c2d8d89c7af6c215f9e2b3078f@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
net/mac80211/cfg.c
net/mac80211/iface.c

index 0f72813fed53e4d94f8f1923da8284a91cd0346a..b90f2131ec7a43f587b009db1714a8cc89c8b3c7 100644 (file)
@@ -3421,12 +3421,15 @@ static void ieee80211_mgmt_frame_register(struct wiphy *wiphy,
                if (!local->open_count)
                        break;
 
-               if (sdata->vif.probe_req_reg == 1)
-                       drv_config_iface_filter(local, sdata, FIF_PROBE_REQ,
-                                               FIF_PROBE_REQ);
-               else if (sdata->vif.probe_req_reg == 0)
-                       drv_config_iface_filter(local, sdata, 0,
-                                               FIF_PROBE_REQ);
+               if (ieee80211_sdata_running(sdata)) {
+                       if (sdata->vif.probe_req_reg == 1)
+                               drv_config_iface_filter(local, sdata,
+                                                       FIF_PROBE_REQ,
+                                                       FIF_PROBE_REQ);
+                       else if (sdata->vif.probe_req_reg == 0)
+                               drv_config_iface_filter(local, sdata, 0,
+                                                       FIF_PROBE_REQ);
+               }
 
                ieee80211_configure_filter(local);
                break;
index d069825705d6dc9cf78d6fc9e2ad0432509bc751..f900c84fb40f59c38eb2261e042825fc61cb2d0c 100644 (file)
@@ -644,6 +644,11 @@ int ieee80211_do_open(struct wireless_dev *wdev, bool coming_up)
                        local->fif_probe_req++;
                }
 
+               if (sdata->vif.probe_req_reg)
+                       drv_config_iface_filter(local, sdata,
+                                               FIF_PROBE_REQ,
+                                               FIF_PROBE_REQ);
+
                if (sdata->vif.type != NL80211_IFTYPE_P2P_DEVICE &&
                    sdata->vif.type != NL80211_IFTYPE_NAN)
                        changed |= ieee80211_reset_erp_info(sdata);