mac80211: disallow moving netns
authorJohannes Berg <johannes@sipsolutions.net>
Wed, 11 Feb 2009 19:27:30 +0000 (20:27 +0100)
committerJohn W. Linville <linville@tuxdriver.com>
Fri, 27 Feb 2009 19:51:39 +0000 (14:51 -0500)
mac80211 currently assumes init_net for all interfaces,
so really will not cope well with network namespaces,
at least at this time.

To change this, we would have keep track of the netns
in addition to the ifindex, which is not something I
want to think about right now.

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

index df94b936526472a5f334559b9c7c7300698fbe4d..e8221180b6c1bf545f52f9c4e9531aaa1ed3df7d 100644 (file)
@@ -798,6 +798,7 @@ int ieee80211_if_add(struct ieee80211_local *local, const char *name,
 
        memcpy(ndev->dev_addr, local->hw.wiphy->perm_addr, ETH_ALEN);
        SET_NETDEV_DEV(ndev, wiphy_dev(local->hw.wiphy));
+       ndev->features |= NETIF_F_NETNS_LOCAL;
 
        /* don't use IEEE80211_DEV_TO_SUB_IF because it checks too much */
        sdata = netdev_priv(ndev);
index 5667f4e8067fdd4f885a507fa15a5085003f1dcd..795f8c4a9fa0464fa9df64e53aabb51452a2ee97 100644 (file)
@@ -916,6 +916,7 @@ int ieee80211_register_hw(struct ieee80211_hw *hw)
 
        memcpy(local->mdev->dev_addr, local->hw.wiphy->perm_addr, ETH_ALEN);
        SET_NETDEV_DEV(local->mdev, wiphy_dev(local->hw.wiphy));
+       local->mdev->features |= NETIF_F_NETNS_LOCAL;
 
        result = register_netdevice(local->mdev);
        if (result < 0)