Browse Source

bonding: Don't allow bond devices to change network namespaces.

Like bridge, bonding as netdevice doesn't cross netns boundaries.

Bonding ports and bonding itself live in same netns.

Signed-off-by: Weilong Chen <chenweilong@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Weilong Chen 11 years ago
parent
commit
f939981492
1 changed files with 3 additions and 0 deletions
  1. 3 0
      drivers/net/bonding/bond_main.c

+ 3 - 0
drivers/net/bonding/bond_main.c

@@ -3884,6 +3884,9 @@ void bond_setup(struct net_device *bond_dev)
 	 * capable
 	 * capable
 	 */
 	 */
 
 
+	/* Don't allow bond devices to change network namespaces. */
+	bond_dev->features |= NETIF_F_NETNS_LOCAL;
+
 	bond_dev->hw_features = BOND_VLAN_FEATURES |
 	bond_dev->hw_features = BOND_VLAN_FEATURES |
 				NETIF_F_HW_VLAN_CTAG_TX |
 				NETIF_F_HW_VLAN_CTAG_TX |
 				NETIF_F_HW_VLAN_CTAG_RX |
 				NETIF_F_HW_VLAN_CTAG_RX |