Skip to content

Commit

Permalink
vlan: Propagate physical MTU changes
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Herbert Xu authored and David S. Miller committed Jul 20, 2009
1 parent 37cf2b8 commit 2e477c9
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions net/8021q/vlan.c
Original file line number Diff line number Diff line change
Expand Up @@ -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++) {
Expand Down

0 comments on commit 2e477c9

Please sign in to comment.