From: dingtianhong <dingtianhong@huawei.com>
Date: Tue, 13 May 2014 06:39:27 +0000 (+0800)
Subject: macvlan: Propagate lowerdev MTU changes
X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=3763e7ef17143f5e9ae044638e65d2b0c0305fcf;p=GitHub%2Fexynos8895%2Fandroid_kernel_samsung_universal8895.git

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: Ding Tianhong <dingtianhong@huawei.com>
Reviewed-by: Jiri Pirko <jiri@resnulli.us>
Signed-off-by: David S. Miller <davem@davemloft.net>
---

diff --git a/drivers/net/macvlan.c b/drivers/net/macvlan.c
index f0118d1a3e46..e03707de1eee 100644
--- a/drivers/net/macvlan.c
+++ b/drivers/net/macvlan.c
@@ -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)