@@ -1162,6 +1162,7 @@ int ieee80211_add_virtual_monitor(struct ieee80211_local *local)
}
}
+ ieee80211_debugfs_recreate_netdev(sdata, false);
set_bit(SDATA_STATE_RUNNING, &sdata->state);
ret = ieee80211_check_queues(sdata, NL80211_IFTYPE_MONITOR);
@@ -1212,6 +1213,7 @@ void ieee80211_del_virtual_monitor(struct ieee80211_local *local)
return;
}
+ clear_bit(SDATA_STATE_RUNNING, &sdata->state);
RCU_INIT_POINTER(local->monitor_sdata, NULL);
mutex_unlock(&local->iflist_mtx);
@@ -1222,6 +1224,7 @@ void ieee80211_del_virtual_monitor(struct ieee80211_local *local)
if (ieee80211_hw_check(&local->hw, WANT_MONITOR_VIF))
drv_remove_interface(local, sdata);
+ ieee80211_debugfs_remove_netdev(sdata);
kfree(sdata);
}
Create debugfs entry for the virtual monitor interface when it's created and delete them again when it's deleted again. Instead of creating them on deletion, when calling drv_remove_interface(). This fixes debugfs name collisions when deleting and re-creating a monitor interface with the same name. Signed-off-by: Alexander Wetzel <Alexander@wetzel-home.de> --- A user can still create collisions in the debugfs when using names like e.g. phy0-monitor for another monitor interface. And then trigger the creation of the virtual monitor interface... But I guess that's ok and not worth the hassle to fix it. --- net/mac80211/iface.c | 3 +++ 1 file changed, 3 insertions(+)