From: Herbert Xu Date: Mon, 20 Jul 2009 14:35:37 +0000 (-0700) Subject: vlan: Propagate physical MTU changes X-Git-Tag: v2.6.32-rc1~703^2~610 X-Git-Url: https://openfabrics.org/gitweb/?a=commitdiff_plain;h=2e477c9bd2bb6a1606e498adb53ba913378ecdf2;p=~shefty%2Frdma-dev.git vlan: Propagate physical MTU changes When the physical MTU changes we want to ensure that all existing VLAN device MTUs do not exceed the new underlying MTU. This patch adds that propagation. Signed-off-by: Herbert Xu Signed-off-by: David S. Miller --- diff --git a/net/8021q/vlan.c b/net/8021q/vlan.c index fe649081fbd..6d37b7e2a76 100644 --- a/net/8021q/vlan.c +++ b/net/8021q/vlan.c @@ -468,6 +468,19 @@ static int vlan_device_event(struct notifier_block *unused, unsigned long event, } break; + case NETDEV_CHANGEMTU: + for (i = 0; i < VLAN_GROUP_ARRAY_LEN; i++) { + vlandev = vlan_group_get_device(grp, i); + if (!vlandev) + continue; + + if (vlandev->mtu <= dev->mtu) + continue; + + dev_set_mtu(vlandev, dev->mtu); + } + break; + case NETDEV_FEAT_CHANGE: /* Propagate device features to underlying device */ for (i = 0; i < VLAN_GROUP_ARRAY_LEN; i++) {