Search Linux Wireless

[PATCH 13/13] mac80211: stop all virtual interfaces when master device goes down

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Michael Wu <flamingice@xxxxxxxxxxxx>

The master device cannot actually veto taking a device down. This patch
makes all virtual devices go down if the master device goes down.

Signed-off-by: Michael Wu <flamingice@xxxxxxxxxxxx>
---

 net/mac80211/ieee80211.c |   13 ++++++-------
 1 files changed, 6 insertions(+), 7 deletions(-)

diff --git a/net/mac80211/ieee80211.c b/net/mac80211/ieee80211.c
index e876e04..6002f2d 100644
--- a/net/mac80211/ieee80211.c
+++ b/net/mac80211/ieee80211.c
@@ -2293,13 +2293,11 @@ static int ieee80211_master_stop(struct net_device *dev)
 	struct ieee80211_sub_if_data *sdata;
 
 	read_lock(&local->sub_if_lock);
-	list_for_each_entry(sdata, &local->sub_if_list, list) {
-		if (sdata->dev != dev && netif_running(sdata->dev)) {
-			read_unlock(&local->sub_if_lock);
-			return -EOPNOTSUPP;
-		}
-	}
+	list_for_each_entry(sdata, &local->sub_if_list, list)
+		if (sdata->dev != dev && netif_running(sdata->dev))
+			dev_close(sdata->dev);
 	read_unlock(&local->sub_if_lock);
+
 	return 0;
 }
 
@@ -2475,7 +2473,8 @@ static int ieee80211_stop(struct net_device *dev)
 	local->open_count--;
 	if (local->open_count == 0) {
 		ieee80211_stop_scan(local);
-		dev_close(local->mdev);
+		if (netif_running(local->mdev))
+			dev_close(local->mdev);
 		if (local->apdev)
 			dev_close(local->apdev);
 		if (local->ops->stop)

-
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Host AP]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Linux Kernel]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Device Mapper]
  Powered by Linux