]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/commitdiff
mac80211: warn on some invalid vlan operations
authorJohannes Berg <johannes@sipsolutions.net>
Wed, 10 Sep 2008 22:02:00 +0000 (00:02 +0200)
committerJohn W. Linville <linville@tuxdriver.com>
Mon, 15 Sep 2008 20:48:23 +0000 (16:48 -0400)
These should never happen, but better warn about them than
crashing a driver, the fact that they never happen is rather
subtle throughout mac80211.

Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
net/mac80211/main.c

index c532043c1a1c001eb41fe7c5ee1c94f125f80c65..dd838b725afbd3c54e565cc33b0acd047b5987da 100644 (file)
@@ -156,6 +156,9 @@ int ieee80211_if_config(struct ieee80211_sub_if_data *sdata, u32 changed)
        if (WARN_ON(!netif_running(sdata->dev)))
                return 0;
 
+       if (WARN_ON(sdata->vif.type == NL80211_IFTYPE_AP_VLAN))
+               return -EINVAL;
+
        if (!local->ops->config_interface)
                return 0;
 
@@ -321,6 +324,9 @@ void ieee80211_bss_info_change_notify(struct ieee80211_sub_if_data *sdata,
 {
        struct ieee80211_local *local = sdata->local;
 
+       if (WARN_ON(sdata->vif.type == NL80211_IFTYPE_AP_VLAN))
+               return;
+
        if (!changed)
                return;