Re: 2.6.6: IPv6 initialisation bug

2 messages, 2 authors, 2004-06-29 · open the first message on its own page

Re: 2.6.6: IPv6 initialisation bug

From: Russell King <hidden>
Date: 2004-06-28 17:48:06

On Tue, Jun 29, 2004 at 02:06:27AM +0900, YOSHIFUJI Hideaki / ?$B5HF#1QL@?(B wrote:
In article [off-list ref] (at Mon, 28 Jun 2004 01:02:01 +0100), Russell King [off-list ref] says:
quoted
Ok, I've just tried 2.6.7 out on my root-NFS'd firewall with IPv6 built
in, and it doesn't work because of the problem I described below.
:
quoted
What's the solution?
Bring lo up before bring others up.
What does prevent you from doing this?
(Do we need some bits to do this automatically?)
When you use root-NFS, the kernel itself brings up the interfaces,
and IPv6 immediately comes in and tries to configure itself to them,
trying to create the routes.

Unfortunately, the kernel doesn't bring up lo first because it
doesn't know to do that.
quoted
Is there a good reason why IPv6 uses the loopback device for local
routes?
IPv6 creates kernel routes for local addresses on lo to receive
packets for local address.

Well, someone probably wants to have
static local routes on ethX + temprary (cache) local routes on lo
(as IPv4 does; correct me if I'm wrong.)
This would be preferable I think - it certainly would stop systems
exploding when you take lo down for whatever reason, even temporarily.
Currently, if you do that, all your IPv6 local routes die off and
you're left trying to forward your own local address out various
itnerfaces.
But this won't work because IPv6 does DAD when we make some interface up.
We need lo anyway.
Sorry, I don't understand how this has a bearing on which device the
local routes are attached to.

How come IPv4 can be happy having local routes attached to the
individual interface, yet IPv6 can't be?

-- 
Russell King
 Linux kernel    2.6 ARM Linux   - http://www.arm.linux.org.uk/
 maintainer of:  2.6 PCMCIA      - http://pcmcia.arm.linux.org.uk/
                 2.6 Serial core

Re: 2.6.6: IPv6 initialisation bug

From: YOSHIFUJI Hideaki / 吉藤英明 <hidden>
Date: 2004-06-29 00:58:00

In article [off-list ref] (at Mon, 28 Jun 2004 18:47:58 +0100), Russell King [off-list ref] says:
On Tue, Jun 29, 2004 at 02:06:27AM +0900, YOSHIFUJI Hideaki / ?$B5HF#1QL@?(B wrote:
quoted
In article [off-list ref] (at Mon, 28 Jun 2004 01:02:01 +0100), Russell King [off-list ref] says:
quoted
Ok, I've just tried 2.6.7 out on my root-NFS'd firewall with IPv6 built
in, and it doesn't work because of the problem I described below.
:
quoted
What's the solution?
Bring lo up before bring others up.
What does prevent you from doing this?
(Do we need some bits to do this automatically?)
When you use root-NFS, the kernel itself brings up the interfaces,
and IPv6 immediately comes in and tries to configure itself to them,
trying to create the routes.

Unfortunately, the kernel doesn't bring up lo first because it
doesn't know to do that.
Okay, would you try the following patch, please?


D: Bring loopback device up first

Signed-Off-By: Hideaki YOSHIFUJI <redacted>

===== net/ipv4/ipconfig.c 1.38 vs edited =====
--- 1.38/net/ipv4/ipconfig.c	2004-06-23 09:06:18 +09:00
+++ edited/net/ipv4/ipconfig.c	2004-06-29 09:53:36 +09:00
@@ -183,7 +183,14 @@
 
 	last = &ic_first_dev;
 	rtnl_shlock();
+
+	/* bring loopback device up first */
+	if (dev_change_flags(&loopback_dev, loopback_dev.flags | IFF_UP) < 0)
+		printk(KERN_ERR "IP-Config: Failed to open %s\n", loopback_dev.name);
+
 	for (dev = dev_base; dev; dev = dev->next) {
+		if (dev == &loopback_dev)
+			continue;
 		if (user_dev_name[0] ? !strcmp(dev->name, user_dev_name) :
 		    (!(dev->flags & IFF_LOOPBACK) &&
 		     (dev->flags & (IFF_POINTOPOINT|IFF_BROADCAST)) &&
-- 
Hideaki YOSHIFUJI @ USAGI Project <yoshfuji@linux-ipv6.org>
GPG FP: 9022 65EB 1ECF 3AD1 0BDF  80D8 4807 F894 E062 0EEA
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help