Netdev List
 help / color / mirror / Atom feed
* [PATCH] [IPV6] ROUTE: Make sending algorithm more friendly with RFC 4861.
@ 2008-01-18 17:00 YOSHIFUJI Hideaki / 吉藤英明
  2008-01-19  8:35 ` David Miller
  0 siblings, 1 reply; 2+ messages in thread
From: YOSHIFUJI Hideaki / 吉藤英明 @ 2008-01-18 17:00 UTC (permalink / raw)
  To: davem; +Cc: yoshfuji, mitch, netdev

We omit (or delay) sending NSes for known-to-unreachable routers
(in NUD_FAILED state) according to RFC 4191 (Default Router Preferences
and More-Specific Routes).
But this is not fully compatible with RFC 4861 (Neighbor Discovery Protocol
for IPv6), which does not remember unreachability of neighbors.

So, let's avoid mixing sending algorithm of RFC 4191 and that of RFC 4861,
and make the algorithm more friendly with RFC 4861 if RFC 4191 is disabled.

Issue was found by IPv6 Ready Logo Core Self_Test 1.5.0b2 (by TAHI Project),
and has been tracked down by Mitsuru Chinen <mitch@linux.vnet.ibm.com>.

Signed-off-by: YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>

--
diff --git a/net/ipv6/route.c b/net/ipv6/route.c
index 6ecb5e6..20083e0 100644
--- a/net/ipv6/route.c
+++ b/net/ipv6/route.c
@@ -329,7 +329,7 @@ static inline int rt6_check_dev(struct rt6_info *rt, int oif)
 static inline int rt6_check_neigh(struct rt6_info *rt)
 {
 	struct neighbour *neigh = rt->rt6i_nexthop;
-	int m = 0;
+	int m;
 	if (rt->rt6i_flags & RTF_NONEXTHOP ||
 	    !(rt->rt6i_flags & RTF_GATEWAY))
 		m = 1;
@@ -337,10 +337,15 @@ static inline int rt6_check_neigh(struct rt6_info *rt)
 		read_lock_bh(&neigh->lock);
 		if (neigh->nud_state & NUD_VALID)
 			m = 2;
-		else if (!(neigh->nud_state & NUD_FAILED))
+#ifdef CONFIG_IPV6_ROUTER_PREF
+		else if (neigh->nud_state & NUD_FAILED)
+			m = 0;
+#endif
+		else
 			m = 1;
 		read_unlock_bh(&neigh->lock);
-	}
+	} else
+		m = 0;
 	return m;
 }
 

-- 
YOSHIFUJI Hideaki @ USAGI Project  <yoshfuji@linux-ipv6.org>
GPG-FP  : 9022 65EB 1ECF 3AD1 0BDF  80D8 4807 F894 E062 0EEA

^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2008-01-19  8:35 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-01-18 17:00 [PATCH] [IPV6] ROUTE: Make sending algorithm more friendly with RFC 4861 YOSHIFUJI Hideaki / 吉藤英明
2008-01-19  8:35 ` David Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox