Skip to content

Commit

Permalink
macvlan: Propagate lowerdev MTU changes
Browse files Browse the repository at this point in the history
When the physical MTU changes we should ensure that all existing MACVLAN
dev MTU do not exceed the new lowerdev MTU. This patch adds that
propagation.

Signed-off-by: Ding Tianhong <dingtianhong@huawei.com>
Reviewed-by: Jiri Pirko <jiri@resnulli.us>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
dingtianhong authored and David S. Miller committed May 14, 2014
1 parent 8ba7e7b commit 3763e7e
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions drivers/net/macvlan.c
Original file line number Diff line number Diff line change
Expand Up @@ -1091,6 +1091,13 @@ static int macvlan_device_event(struct notifier_block *unused,
netdev_update_features(vlan->dev);
}
break;
case NETDEV_CHANGEMTU:
list_for_each_entry(vlan, &port->vlans, list) {
if (vlan->dev->mtu <= dev->mtu)
continue;
dev_set_mtu(vlan->dev, dev->mtu);
}
break;
case NETDEV_UNREGISTER:
/* twiddle thumbs on netns device moves */
if (dev->reg_state != NETREG_UNREGISTERING)
Expand Down

0 comments on commit 3763e7e

Please sign in to comment.