Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 3763e7ef authored by dingtianhong's avatar dingtianhong Committed by David S. Miller
Browse files

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: default avatarDing Tianhong <dingtianhong@huawei.com>
Reviewed-by: default avatarJiri Pirko <jiri@resnulli.us>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 8ba7e7bf
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -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)