Re: Bug in Linux 2.5.74 IPv6 routing

3 messages, 2 authors, 2003-07-10 · open the first message on its own page

Re: Bug in Linux 2.5.74 IPv6 routing

From: YOSHIFUJI Hideaki / 吉藤英明 <hidden>
Date: 2003-07-09 18:17:51

CC: netdev

In article [off-list ref] (at Wed, 9 Jul 2003 19:52:37 +0200), Jean-Luc Richier [off-list ref] says:
There is a bug in IPv6 route calculation since kernel 2.5.71. It affects
all routes with prefix length != 0 (mod 8)
The bug is as follows:
do:	ip -6 route add 2000::/3 via 2001:688:121:10::1
	ip -6 route
It shows a route for ::/3, not for 2000::/3
good catch.
quoted hunk
PATCH 2: avoid overwriting the set value
--- linux-2.5.74/include/net/ipv6.h.DIST	2003-07-02 22:53:44.000000000 +0200
+++ linux-2.5.74/include/net/ipv6.h	2003-07-09 18:51:25.000000000 +0200
@@ -276,8 +276,10 @@
 	    b = plen & 0x7;
 
 	memcpy(pfx->s6_addr, addr, o);
-	if (b != 0)
+	if (b != 0) {
 		pfx->s6_addr[o] = addr->s6_addr[o] & (0xff00 >> b);
+		o++;
+	}
 	if (o < 16)
 		memset(pfx->s6_addr + o, 0, 16 - o);
 }
Ok, let's use this one.

--yoshfuji

Re: Bug in Linux 2.5.74 IPv6 routing

From: YOSHIFUJI Hideaki / 吉藤英明 <hidden>
Date: 2003-07-09 18:44:25

In article [off-list ref] (at Thu, 10 Jul 2003 03:31:17 +0900 (JST)), YOSHIFUJI Hideaki / 吉藤英明 [off-list ref] says:
Ok, let's use this one.
Please apply this patch.

D: Fix ipv6_addr_prefix() for prefixlen != 0 (mod 8).
D: Patch from Jean-Luc RICHIER [off-list ref].
--- linux-2.5.74/include/net/ipv6.h.DIST	2003-07-02 22:53:44.000000000 +0200
+++ linux-2.5.74/include/net/ipv6.h	2003-07-09 18:51:25.000000000 +0200
@@ -276,8 +276,10 @@
 	    b = plen & 0x7;
 
 	memcpy(pfx->s6_addr, addr, o);
-	if (b != 0)
+	if (b != 0) {
 		pfx->s6_addr[o] = addr->s6_addr[o] & (0xff00 >> b);
+		o++;
+	}
 	if (o < 16)
 		memset(pfx->s6_addr + o, 0, 16 - o);
 }
-- 
Hideaki YOSHIFUJI @ USAGI Project <yoshfuji@linux-ipv6.org>
GPG FP: 9022 65EB 1ECF 3AD1 0BDF  80D8 4807 F894 E062 0EEA

Re: Bug in Linux 2.5.74 IPv6 routing

From: James Morris <hidden>
Date: 2003-07-10 01:30:55

On Thu, 10 Jul 2003, YOSHIFUJI Hideaki / [iso-2022-jp] $B5HF#1QL@(B wrote:
Please apply this patch.

D: Fix ipv6_addr_prefix() for prefixlen != 0 (mod 8).
D: Patch from Jean-Luc RICHIER [off-list ref].
Applied to bk://kernel.bkbits.net/jmorris/net-2.5


-- 
James Morris
[off-list ref]
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help