diff options
author | Denis Kenzior <denkenz@gmail.com> | 2016-08-04 00:58:35 +0300 |
---|---|---|
committer | Johannes Berg <johannes.berg@intel.com> | 2016-08-11 17:51:42 +0300 |
commit | 7f8ed01ea5d4d9d4acc3bb046de1fc84ac83a5e2 (patch) | |
tree | 6387f94b3e3e3ecc4a80e41c0f68b16e0ce59d4d /net/wireless/core.c | |
parent | 896ff0635a312022c91e2bef30c80abc27af62e8 (diff) | |
download | linux-7f8ed01ea5d4d9d4acc3bb046de1fc84ac83a5e2.tar.xz |
cfg80211: always notify userspace when wireless netdev is removed
This change alters the semantics of NL80211_CMD_DEL_INTERFACE events
by always sending this event whenever a net_device object associated
with a wdev is destroyed. Prior to this change, this event was only
emitted as a result of NL80211_CMD_DEL_INTERFACE command sent from
userspace. This allows userspace to reliably detect when wireless
interfaces have been removed, e.g. due to USB removal events, etc.
For wireless device objects without an associated net_device (e.g.
NL80211_IFTYPE_P2P_DEVICE), the NL80211_CMD_DEL_INTERFACE event is
now generated inside cfg80211_unregister_wdev.
Signed-off-by: Denis Kenzior <denkenz@gmail.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Diffstat (limited to 'net/wireless/core.c')
-rw-r--r-- | net/wireless/core.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/net/wireless/core.c b/net/wireless/core.c index 7758c0fe781a..2029b49a1df3 100644 --- a/net/wireless/core.c +++ b/net/wireless/core.c @@ -906,6 +906,8 @@ void cfg80211_unregister_wdev(struct wireless_dev *wdev) if (WARN_ON(wdev->netdev)) return; + nl80211_notify_iface(rdev, wdev, NL80211_CMD_DEL_INTERFACE); + list_del_rcu(&wdev->list); rdev->devlist_generation++; @@ -1159,6 +1161,8 @@ static int cfg80211_netdev_notifier_call(struct notifier_block *nb, * remove and clean it up. */ if (!list_empty(&wdev->list)) { + nl80211_notify_iface(rdev, wdev, + NL80211_CMD_DEL_INTERFACE); sysfs_remove_link(&dev->dev.kobj, "phy80211"); list_del_rcu(&wdev->list); rdev->devlist_generation++; |