nl80211: only allow adding stations to running vlan interfaces
authorFelix Fietkau <nbd@openwrt.org>
Wed, 11 Nov 2009 16:23:31 +0000 (17:23 +0100)
committerJohn W. Linville <linville@tuxdriver.com>
Fri, 13 Nov 2009 22:43:59 +0000 (17:43 -0500)
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
net/wireless/nl80211.c

index 5c8b3bfada4b8813bbe21c8b29e5c5d19ccc6c52..37264d56bace7fe79f7e7eb605c2a4b36ae6af72 100644 (file)
@@ -1821,7 +1821,7 @@ static int nl80211_get_station(struct sk_buff *skb, struct genl_info *info)
 }
 
 /*
- * Get vlan interface making sure it is on the right wiphy.
+ * Get vlan interface making sure it is running and on the right wiphy.
  */
 static int get_vlan(struct genl_info *info,
                    struct cfg80211_registered_device *rdev,
@@ -1839,6 +1839,8 @@ static int get_vlan(struct genl_info *info,
                        return -EINVAL;
                if ((*vlan)->ieee80211_ptr->wiphy != &rdev->wiphy)
                        return -EINVAL;
+               if (!netif_running(*vlan))
+                       return -ENETDOWN;
        }
        return 0;
 }