Thread (5 messages) 5 messages, 4 authors, 2004-08-24

Re: IPv6 oops on ifup in latest BK

From: YOSHIFUJI Hideaki / 吉藤英明 <hidden>
Date: 2004-08-24 08:21:37
Also in: lkml

In article [ref] (at Mon, 23 Aug 2004 23:51:23 -0700), "David S. Miller" [off-list ref] says:
quoted
Attached minicom.cap.txt gives the ksymoops output and dmesg output. 
Appears to die in ipv6_get_hoplimit.
Yoshifuji-san, it is rt6i_dev changes.  The problem is that
ipv6_get_hoplimit() gets called with NULL dev.
:
It is this piece of code in ip6_route_add():

		if (dev && dev != &loopback_dev) {

It does not handle the case where dev == NULL correctly.
Original code did do the right thing:

		if (dev)
			dev_put(dev);
		dev = &loopback_dev;
		dev_hold(dev);
Good catch and spotting.  Please try this patch.
Thank you.

===== net/ipv6/route.c 1.88 vs edited =====
--- 1.88/net/ipv6/route.c	2004-08-17 11:25:06 +09:00
+++ edited/net/ipv6/route.c	2004-08-24 17:09:10 +09:00
@@ -820,9 +820,12 @@
 	 */
 	if ((rtmsg->rtmsg_flags&RTF_REJECT) ||
 	    (dev && (dev->flags&IFF_LOOPBACK) && !(addr_type&IPV6_ADDR_LOOPBACK))) {
-		if (dev && dev != &loopback_dev) {
-			dev_put(dev);
-			in6_dev_put(idev);
+		/* hold loopback dev/idev if we haven't done so. */
+		if (dev != &loopback_dev) {
+			if (dev) {
+				dev_put(dev);
+				in6_dev_put(idev);
+			}
 			dev = &loopback_dev;
 			dev_hold(dev);
 			idev = in6_dev_get(dev);

-- 
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