team: Don't allow team devices to change network namespaces.
authorWeilong Chen <chenweilong@huawei.com>
Thu, 23 Jan 2014 03:07:22 +0000 (11:07 +0800)
committerDavid S. Miller <davem@davemloft.net>
Thu, 23 Jan 2014 05:57:17 +0000 (21:57 -0800)
Like bonding, team as netdevice doesn't cross netns boundaries.

Team ports and team itself live in same netns.

Signed-off-by: Weilong Chen <chenweilong@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/team/team.c

index dff24e3dde4aa602dd8ba8118d8dc05a33a55c65..28407426fd6fdbc7dc0e21eb83c8acaba380065b 100644 (file)
@@ -2034,6 +2034,10 @@ static void team_setup(struct net_device *dev)
 
        dev->features |= NETIF_F_LLTX;
        dev->features |= NETIF_F_GRO;
+
+       /* Don't allow team devices to change network namespaces. */
+       dev->features |= NETIF_F_NETNS_LOCAL;
+
        dev->hw_features = TEAM_VLAN_FEATURES |
                           NETIF_F_HW_VLAN_CTAG_TX |
                           NETIF_F_HW_VLAN_CTAG_RX |