Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1764773AbXLMHRi (ORCPT ); Thu, 13 Dec 2007 02:17:38 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1762615AbXLMG60 (ORCPT ); Thu, 13 Dec 2007 01:58:26 -0500 Received: from pentafluge.infradead.org ([213.146.154.40]:55666 "EHLO pentafluge.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1759655AbXLMG6Y (ORCPT ); Thu, 13 Dec 2007 01:58:24 -0500 Date: Wed, 12 Dec 2007 22:53:30 -0800 From: Greg KH To: linux-kernel@vger.kernel.org, stable@kernel.org, bunk@kernel.org, davem@davemloft.net Cc: Justin Forbes , Zwane Mwaikambo , "Theodore Ts'o" , Randy Dunlap , Dave Jones , Chuck Wolber , Chris Wedgwood , Michael Krufky , Chuck Ebbert , Domenico Andreoli , torvalds@linux-foundation.org, akpm@linux-foundation.org, alan@lxorguk.ukuu.org.uk, Evgeniy Polyakov , Herbert Xu Subject: [patch 52/60] IPV6: Restore IPv6 when MTU is big enough Message-ID: <20071213065330.GB6867@kroah.com> References: <20071213064518.328162328@mini.kroah.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline; filename="ipv6-restore-ipv6-when-mtu-is-big-enough.patch" In-Reply-To: <20071213065039.GA6867@kroah.com> User-Agent: Mutt/1.5.16 (2007-06-09) X-Bad-Reply: References and In-Reply-To but no 'Re:' in Subject. Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1877 Lines: 69 2.6.23-stable review patch. If anyone has any objections, please let us know. ------------------ From: Evgeniy Polyakov [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 --- net/ipv6/addrconf.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) --- a/net/ipv6/addrconf.c +++ b/net/ipv6/addrconf.c @@ -2281,6 +2281,9 @@ static int addrconf_notify(struct notifi 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 notifi 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: -- -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/