From: Evgeniy Polyakov Date: Tue, 11 Dec 2007 01:39:34 +0000 (+0800) Subject: IPV6: Restore IPv6 when MTU is big enough X-Git-Tag: v2.6.23.10~9 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=978cf44ec452e8fa359b2562a98977d0f76a5b6a;p=thirdparty%2Fkernel%2Fstable.git IPV6: Restore IPv6 when MTU is big enough [IPV6]: Restore IPv6 when MTU is big enough [ Upstream commit: d31c7b8fa303eb81311f27b80595b8d2cbeef950 ] 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 Signed-off-by: Herbert Xu Signed-off-by: Greg Kroah-Hartman --- diff --git a/net/ipv6/addrconf.c b/net/ipv6/addrconf.c index 45b4c82148a06..09179449db862 100644 --- a/net/ipv6/addrconf.c +++ b/net/ipv6/addrconf.c @@ -2281,6 +2281,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 { @@ -2345,12 +2348,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: