From b01f236c66b214a73816a4083050f73481638a72 Mon Sep 17 00:00:00 2001 From: Veaceslav Falico Date: Thu, 16 Jan 2014 00:02:19 +0100 Subject: team: block mtu change before it happens via NETDEV_PRECHANGEMTU Now it catches the NETDEV_CHANGEMTU notification, which is signaled after the actual change happened on the device, and returns NOTIFY_BAD, so that the change on the device is reverted. This might be quite costly and messy, so use the new NETDEV_PRECHANGEMTU to catch the MTU change before the actual change happens and signal that it's forbidden to do it. CC: Jiri Pirko Signed-off-by: Veaceslav Falico Acked-by: Jiri Pirko Signed-off-by: David S. Miller --- drivers/net/team/team.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'drivers/net/team/team.c') diff --git a/drivers/net/team/team.c b/drivers/net/team/team.c index b75ae5bde673..dff24e3dde4a 100644 --- a/drivers/net/team/team.c +++ b/drivers/net/team/team.c @@ -2851,7 +2851,7 @@ static int team_device_event(struct notifier_block *unused, case NETDEV_FEAT_CHANGE: team_compute_features(port->team); break; - case NETDEV_CHANGEMTU: + case NETDEV_PRECHANGEMTU: /* Forbid to change mtu of underlaying device */ return NOTIFY_BAD; case NETDEV_PRE_TYPE_CHANGE: -- cgit v1.2.1 From 99301ba11cb72f68f4e43e5778106035bd6965c4 Mon Sep 17 00:00:00 2001 From: Weilong Chen Date: Thu, 23 Jan 2014 11:07:22 +0800 Subject: team: Don't allow team devices to change network namespaces. Like bonding, team as netdevice doesn't cross netns boundaries. Team ports and team itself live in same netns. Signed-off-by: Weilong Chen Signed-off-by: David S. Miller --- drivers/net/team/team.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'drivers/net/team/team.c') diff --git a/drivers/net/team/team.c b/drivers/net/team/team.c index dff24e3dde4a..28407426fd6f 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 | -- cgit v1.2.1