提交 076ae609 编写于 作者: J Johannes Berg 提交者: John W. Linville

mac80211: disallow moving netns

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: NJohannes Berg <johannes@sipsolutions.net>
Cc: Eric W. Biederman <ebiederm@xmission.com>
Signed-off-by: NJohn W. Linville <linville@tuxdriver.com>
上级 53d6f81c
...@@ -798,6 +798,7 @@ int ieee80211_if_add(struct ieee80211_local *local, const char *name, ...@@ -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); memcpy(ndev->dev_addr, local->hw.wiphy->perm_addr, ETH_ALEN);
SET_NETDEV_DEV(ndev, wiphy_dev(local->hw.wiphy)); 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 */ /* don't use IEEE80211_DEV_TO_SUB_IF because it checks too much */
sdata = netdev_priv(ndev); sdata = netdev_priv(ndev);
......
...@@ -916,6 +916,7 @@ int ieee80211_register_hw(struct ieee80211_hw *hw) ...@@ -916,6 +916,7 @@ int ieee80211_register_hw(struct ieee80211_hw *hw)
memcpy(local->mdev->dev_addr, local->hw.wiphy->perm_addr, ETH_ALEN); memcpy(local->mdev->dev_addr, local->hw.wiphy->perm_addr, ETH_ALEN);
SET_NETDEV_DEV(local->mdev, wiphy_dev(local->hw.wiphy)); SET_NETDEV_DEV(local->mdev, wiphy_dev(local->hw.wiphy));
local->mdev->features |= NETIF_F_NETNS_LOCAL;
result = register_netdevice(local->mdev); result = register_netdevice(local->mdev);
if (result < 0) if (result < 0)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册