aboutsummaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorEvgeniy Polyakov <johnpol@2ka.mipt.ru>2007-11-30 07:36:08 -0500
committerHerbert Xu <herbert@gondor.apana.org.au>2007-11-30 07:36:08 -0500
commitd31c7b8fa303eb81311f27b80595b8d2cbeef950 (patch)
tree171cfad23d2ee23f68c0ed89f4a1f70c0ed0db96 /net
parentd5a784b3719ae364f49ecff12a0248f6e4252720 (diff)
[IPV6]: Restore IPv6 when MTU is big enough
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>
Diffstat (limited to 'net')
-rw-r--r--net/ipv6/addrconf.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/net/ipv6/addrconf.c b/net/ipv6/addrconf.c
index 567664eac463..e8c347579da9 100644
--- a/net/ipv6/addrconf.c
+++ b/net/ipv6/addrconf.c
@@ -2293,6 +2293,9 @@ static int addrconf_notify(struct notifier_block *this, unsigned long event,
2293 break; 2293 break;
2294 } 2294 }
2295 2295
2296 if (!idev && dev->mtu >= IPV6_MIN_MTU)
2297 idev = ipv6_add_dev(dev);
2298
2296 if (idev) 2299 if (idev)
2297 idev->if_flags |= IF_READY; 2300 idev->if_flags |= IF_READY;
2298 } else { 2301 } else {
@@ -2357,12 +2360,18 @@ static int addrconf_notify(struct notifier_block *this, unsigned long event,
2357 break; 2360 break;
2358 2361
2359 case NETDEV_CHANGEMTU: 2362 case NETDEV_CHANGEMTU:
2360 if ( idev && dev->mtu >= IPV6_MIN_MTU) { 2363 if (idev && dev->mtu >= IPV6_MIN_MTU) {
2361 rt6_mtu_change(dev, dev->mtu); 2364 rt6_mtu_change(dev, dev->mtu);
2362 idev->cnf.mtu6 = dev->mtu; 2365 idev->cnf.mtu6 = dev->mtu;
2363 break; 2366 break;
2364 } 2367 }
2365 2368
2369 if (!idev && dev->mtu >= IPV6_MIN_MTU) {
2370 idev = ipv6_add_dev(dev);
2371 if (idev)
2372 break;
2373 }
2374
2366 /* MTU falled under IPV6_MIN_MTU. Stop IPv6 on this interface. */ 2375 /* MTU falled under IPV6_MIN_MTU. Stop IPv6 on this interface. */
2367 2376
2368 case NETDEV_DOWN: 2377 case NETDEV_DOWN: