All of lore.kernel.org
 help / color / mirror / Atom feed
From: ebiederm@xmission.com (Eric W. Biederman)
To: David Miller <davem@davemloft.net>
Cc: Brian Haley <brian.haley@hp.com>,
	netdev@vger.kernel.org, Mahesh Kelkar <maheshkelkar@gmail.com>,
	Lorenzo Colitti <lorenzo@google.com>,
	YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>,
	Stephen Hemminger <shemminger@vyatta.com>
Cc: stable@kernel.org
Subject: [PATCH] Fix 2.6.34-rc1 regression in  disable_ipv6 support
Date: Wed, 08 Dec 2010 20:16:27 -0800	[thread overview]
Message-ID: <m1mxofa8dg.fsf_-_@fess.ebiederm.org> (raw)
In-Reply-To: <m1ipz3d46m.fsf@fess.ebiederm.org> (Eric W. Biederman's message of "Wed, 08 Dec 2010 19:18:41 -0800")


In a number of instances it is desirable to have systems that run with
ipv6 disabled, but where enabling ipv6 remains an option.  This
has been broken since 2.6.34-rc1.

The problem is failure mode is that after
# ip link set lo up
# echo 1 > /proc/sys/net/ipv6/conf/lo/disable_ipv6
# echo 0 > /proc/sys/net/ipv6/conf/lo/disable_ipv6
# ping6 ::1

The ping and anything similar operations that use the
ipv6 loopback address fail with network not reachable.

This failure mode appears to start with:
   commit dc2b99f71ef477a31020511876ab4403fb7c4420
   Author: stephen hemminger <shemminger@vyatta.com>
   Date:   Mon Feb 8 19:48:05 2010 +0000
   
       IPv6: keep permanent addresses on admin down
       
       Permanent IPV6 addresses should not be removed when the link is
       set to admin down, only when device is removed.
       
       When link is lost permanent addresses should be marked as tentative
       so that when link comes back they are subject to duplicate address
       detection (if DAD was enabled for that address).
       
       Other routing systems keep manually configured IPv6 addresses
       when link is set down.
       
       Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
       Signed-off-by: David S. Miller <davem@davemloft.net>

Keeping ipv6 addresses on network interfaces when we bring those
interfaces down is not the fundamental problem.  The real problem is
that there is something about routes and route-caches that make local
ipv6 address unreachable after the loopback interface is brought down,
and then brought up again, and it has been that way since at least
2.6.32.

Finding the real bug is beyond me right now, but fixing the regression
in disable_ipv6 is simple.  We can just delete ::1 when we bring down
the loopback interface, and it will be restored automatically when we
bring the loopback interface back up.

Signed-off-by: "Eric W. Biederman" <ebiederm@xmission.com>
---
Index: linux-2.6.37-rc5.x86_64/net/ipv6/addrconf.c
===================================================================
--- linux-2.6.37-rc5.x86_64.orig/net/ipv6/addrconf.c
+++ linux-2.6.37-rc5.x86_64/net/ipv6/addrconf.c
@@ -2727,6 +2727,7 @@ static int addrconf_ifdown(struct net_de
 		/* If just doing link down, and address is permanent
 		   and not link-local, then retain it. */
 		if (!how &&
+		    !ipv6_addr_loopback(&ifa->addr) &&
 		    (ifa->flags&IFA_F_PERMANENT) &&
 		    !(ipv6_addr_type(&ifa->addr) & IPV6_ADDR_LINKLOCAL)) {
 			list_move_tail(&ifa->if_list, &keep_list);

  reply	other threads:[~2010-12-09  4:16 UTC|newest]

Thread overview: 44+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-12-06  0:24 echo > 0 .../disable_ipv6 broken in 2.6.37-rc4 Eric W. Biederman
2010-12-06  0:33 ` Lorenzo Colitti
2010-12-06  0:39   ` Eric W. Biederman
2010-12-06  5:51     ` Eric W. Biederman
2010-12-06 16:10 ` Brian Haley
2010-12-08 21:29   ` Eric W. Biederman
2010-12-08 22:49     ` Brian Haley
2010-12-08 23:13       ` Eric W. Biederman
2010-12-08 23:49         ` Stephen Hemminger
2010-12-09  2:42           ` Eric W. Biederman
2010-12-09  3:18             ` Eric W. Biederman
2010-12-09  4:16               ` Eric W. Biederman [this message]
2010-12-09 15:28                 ` [PATCH] Fix 2.6.34-rc1 regression in disable_ipv6 support Brian Haley
2010-12-09 16:27                   ` Stephen Hemminger
2010-12-09 19:22                     ` Eric W. Biederman
2010-12-09 19:09                   ` Eric W. Biederman
2010-12-09 19:16                     ` Stephen Hemminger
2010-12-09 19:31                       ` Eric W. Biederman
2010-12-09 20:20                         ` David Miller
2010-12-09 20:20                       ` David Miller
2010-12-09 22:51                         ` Stephen Hemminger
2010-12-16 21:28                         ` [RFC] ipv6: don't flush routes when setting loopback down Stephen Hemminger
2010-12-16 23:17                           ` Eric W. Biederman
2010-12-17  1:18                           ` Eric W. Biederman
2010-12-17  2:26                             ` David Miller
2011-01-19 19:18                               ` Jiri Bohac
2011-01-19 19:38                                 ` Stephen Hemminger
2011-01-19 19:56                                   ` Jiri Bohac
2011-01-19 20:01                                     ` Stephen Hemminger
2011-01-22  8:17                                       ` Eric W. Biederman
2011-01-22 22:39                                         ` Stephen Hemminger
2011-01-22 22:54                                           ` David Miller
2011-01-23  4:41                                             ` Stephen Hemminger
2011-01-23  5:42                                               ` David Miller
2011-01-23  8:24                                                 ` Stephen Hemminger
2011-01-23  8:26                                                   ` Stephen Hemminger
2011-01-23  9:15                                                     ` [stable] " Willy Tarreau
2011-01-23  9:21                                                       ` Stephen Hemminger
2011-01-23 10:34                                                       ` Stephen Hemminger
2011-01-23 19:21                                                         ` Eric W. Biederman
2011-01-23 19:57                                                           ` [stable] " David Miller
2011-01-23 19:48                                                     ` David Miller
2011-01-23 19:47                                                   ` David Miller
2010-12-10  4:02                   ` [PATCH] Fix 2.6.34-rc1 regression in disable_ipv6 support Stephen Hemminger

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=m1mxofa8dg.fsf_-_@fess.ebiederm.org \
    --to=ebiederm@xmission.com \
    --cc=brian.haley@hp.com \
    --cc=davem@davemloft.net \
    --cc=lorenzo@google.com \
    --cc=maheshkelkar@gmail.com \
    --cc=netdev@vger.kernel.org \
    --cc=shemminger@vyatta.com \
    --cc=yoshfuji@linux-ipv6.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.