mac80211: allow using network namespaces
authorJohannes Berg <johannes@sipsolutions.net>
Mon, 13 Jul 2009 22:33:36 +0000 (00:33 +0200)
committerJohn W. Linville <linville@tuxdriver.com>
Mon, 27 Jul 2009 19:24:08 +0000 (15:24 -0400)
This finally opens up the ability to put mac80211 devices
into different network namespaces. As long as you don't
have sysfs, that is.

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

index 559d698..0cb29df 100644 (file)
@@ -787,6 +787,7 @@ int ieee80211_if_add(struct ieee80211_local *local, const char *name,
                            name, ieee80211_if_setup);
        if (!ndev)
                return -ENOMEM;
+       dev_net_set(ndev, wiphy_net(local->hw.wiphy));
 
        ndev->needed_headroom = local->tx_headroom +
                                4*6 /* four MAC addresses */
index 3234f37..02cabbf 100644 (file)
@@ -620,6 +620,7 @@ struct ieee80211_hw *ieee80211_alloc_hw(size_t priv_data_len,
        if (!wiphy)
                return NULL;
 
+       wiphy->netnsok = true;
        wiphy->privid = mac80211_wiphy_privid;
 
        /* Yes, putting cfg80211_bss into ieee80211_bss is a hack */