Skip to content

Commit

Permalink
[IPV6]: Restore IPv6 when MTU is big enough
Browse files Browse the repository at this point in the history
Avaid provided test application, so bug got fixed.

IPv6 addrconf removes ipv6 inner device from netdev each time cmu
changes and new value is less than IPV6_MIN_MTU (1280 bytes).
When mtu is changed and new value is greater than IPV6_MIN_MTU,
it does not add ipv6 addresses and inner device bac.

This patch fixes that.

Tested with Avaid's application, which works ok now.

Signed-off-by: Evgeniy Polyakov <johnpol@2ka.mipt.ru>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
  • Loading branch information
Evgeniy Polyakov authored and Herbert Xu committed Nov 30, 2007
1 parent d5a784b commit d31c7b8
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion net/ipv6/addrconf.c
Original file line number Diff line number Diff line change
Expand Up @@ -2293,6 +2293,9 @@ static int addrconf_notify(struct notifier_block *this, unsigned long event,
break;
}

if (!idev && dev->mtu >= IPV6_MIN_MTU)
idev = ipv6_add_dev(dev);

if (idev)
idev->if_flags |= IF_READY;
} else {
Expand Down Expand Up @@ -2357,12 +2360,18 @@ static int addrconf_notify(struct notifier_block *this, unsigned long event,
break;

case NETDEV_CHANGEMTU:
if ( idev && dev->mtu >= IPV6_MIN_MTU) {
if (idev && dev->mtu >= IPV6_MIN_MTU) {
rt6_mtu_change(dev, dev->mtu);
idev->cnf.mtu6 = dev->mtu;
break;
}

if (!idev && dev->mtu >= IPV6_MIN_MTU) {
idev = ipv6_add_dev(dev);
if (idev)
break;
}

/* MTU falled under IPV6_MIN_MTU. Stop IPv6 on this interface. */

case NETDEV_DOWN:
Expand Down

0 comments on commit d31c7b8

Please sign in to comment.