aboutsummaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorYOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>2008-01-19 03:35:16 -0500
committerDavid S. Miller <davem@davemloft.net>2008-01-20 23:31:40 -0500
commit398bcbebb6f721ac308df1e3d658c0029bb74503 (patch)
treeef9a070fa1214d45fac153b7953ce984ac10acd5 /net
parent8d3f099abe25c21670cb5728178a1f286952782d (diff)
[IPV6] ROUTE: Make sending algorithm more friendly with RFC 4861.
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> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net')
-rw-r--r--net/ipv6/route.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/net/ipv6/route.c b/net/ipv6/route.c
index 6ecb5e6fae2e..20083e0d3995 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)
329static inline int rt6_check_neigh(struct rt6_info *rt) 329static inline int rt6_check_neigh(struct rt6_info *rt)
330{ 330{
331 struct neighbour *neigh = rt->rt6i_nexthop; 331 struct neighbour *neigh = rt->rt6i_nexthop;
332 int m = 0; 332 int m;
333 if (rt->rt6i_flags & RTF_NONEXTHOP || 333 if (rt->rt6i_flags & RTF_NONEXTHOP ||
334 !(rt->rt6i_flags & RTF_GATEWAY)) 334 !(rt->rt6i_flags & RTF_GATEWAY))
335 m = 1; 335 m = 1;
@@ -337,10 +337,15 @@ static inline int rt6_check_neigh(struct rt6_info *rt)
337 read_lock_bh(&neigh->lock); 337 read_lock_bh(&neigh->lock);
338 if (neigh->nud_state & NUD_VALID) 338 if (neigh->nud_state & NUD_VALID)
339 m = 2; 339 m = 2;
340 else if (!(neigh->nud_state & NUD_FAILED)) 340#ifdef CONFIG_IPV6_ROUTER_PREF
341 else if (neigh->nud_state & NUD_FAILED)
342 m = 0;
343#endif
344 else
341 m = 1; 345 m = 1;
342 read_unlock_bh(&neigh->lock); 346 read_unlock_bh(&neigh->lock);
343 } 347 } else
348 m = 0;
344 return m; 349 return m;
345} 350}
346 351