提交 3763e7ef 编写于 作者: D dingtianhong 提交者: David S. Miller

macvlan: Propagate lowerdev MTU changes

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: NDing Tianhong <dingtianhong@huawei.com>
Reviewed-by: NJiri Pirko <jiri@resnulli.us>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 8ba7e7bf
......@@ -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)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册