diff options
author | Herbert Xu <herbert@gondor.apana.org.au> | 2009-07-20 10:35:37 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2009-07-20 10:35:37 -0400 |
commit | 2e477c9bd2bb6a1606e498adb53ba913378ecdf2 (patch) | |
tree | fc1e7b9488cac5a66ac1c5f2196a2400fe5fdf52 /net/8021q | |
parent | 37cf2b8d1622897cf57e70cdab9eba57feb5ff6c (diff) |
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 <herbert@gondor.apana.org.au>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/8021q')
-rw-r--r-- | net/8021q/vlan.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/net/8021q/vlan.c b/net/8021q/vlan.c index fe649081fbdc..6d37b7e2a767 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, | |||
468 | } | 468 | } |
469 | break; | 469 | break; |
470 | 470 | ||
471 | case NETDEV_CHANGEMTU: | ||
472 | for (i = 0; i < VLAN_GROUP_ARRAY_LEN; i++) { | ||
473 | vlandev = vlan_group_get_device(grp, i); | ||
474 | if (!vlandev) | ||
475 | continue; | ||
476 | |||
477 | if (vlandev->mtu <= dev->mtu) | ||
478 | continue; | ||
479 | |||
480 | dev_set_mtu(vlandev, dev->mtu); | ||
481 | } | ||
482 | break; | ||
483 | |||
471 | case NETDEV_FEAT_CHANGE: | 484 | case NETDEV_FEAT_CHANGE: |
472 | /* Propagate device features to underlying device */ | 485 | /* Propagate device features to underlying device */ |
473 | for (i = 0; i < VLAN_GROUP_ARRAY_LEN; i++) { | 486 | for (i = 0; i < VLAN_GROUP_ARRAY_LEN; i++) { |