diff mbox

team: Don't allow team devices to change network namespaces.

Message ID 1390446442-12768-1-git-send-email-chenweilong@huawei.com
State Accepted, archived
Delegated to: David Miller
Headers show

Commit Message

chenweilong Jan. 23, 2014, 3:07 a.m. UTC
From: Weilong Chen <chenweilong@huawei.com>

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>
---
 drivers/net/team/team.c | 4 ++++
 1 file changed, 4 insertions(+)

Comments

David Miller Jan. 23, 2014, 5:59 a.m. UTC | #1
From: Chen Weilong <chenweilong@huawei.com>
Date: Thu, 23 Jan 2014 11:07:22 +0800

> From: Weilong Chen <chenweilong@huawei.com>
> 
> 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>

Applied.
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/drivers/net/team/team.c b/drivers/net/team/team.c
index dff24e3..2840742 100644
--- a/drivers/net/team/team.c
+++ b/drivers/net/team/team.c
@@ -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 |