Skip to contentSkip to conversation

ipv6: host should probe those non-reachable router

PATCH In review Duan Jiong 2 participants 2 messages Nov 1, 2013

Subsystems (3)
lore
Share & tools
lore

Duan Jiong

author
#0 lore raw

PATCH 1/1 ipv6: host should probe those non-reachable router

rather than those routers that the return value of rt6_score_route() is RT6_NUD_SUCCEED.

---
 net/ipv6/route.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)
net/ipv6/route.c +2 -3
index 1ac0b6e..b7bf5c7 100644
@@ -623,12 +623,11 @@ static struct rt6_info *find_match(struct rt6_info *rt, int oif, int strict,
 		match_do_rr = true;
 		m = 0; /* lowest valid score */
 	} else if (m < 0) {
+		if (strict & RT6_LOOKUP_F_REACHABLE)
+			rt6_probe(rt);
 		goto out;
 	}
 
-	if (strict & RT6_LOOKUP_F_REACHABLE)
-		rt6_probe(rt);
-
 	if (m > *mpri) {
 		*do_rr = match_do_rr;
 		*mpri = m;
Signature · 1 line
1.8.3.1
#1 lore raw

Hi Duan!

Quoted 15 lines · Duan Jiong

rather than those routers that the return value of rt6_score_route() is RT6_NUD_SUCCEED.

---
 net/ipv6/route.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)
net/ipv6/route.c +0 -0
index 1ac0b6e..b7bf5c7 100644
@@ -623,12 +623,11 @@ static struct rt6_info *find_match(struct rt6_info *rt, int oif, int strict,
 		match_do_rr = true;

net/ipv6/route.c static struct rt6_info *find_match(struct rt6_info *rt, int oif, int strict, · line 631

Quoted 10 lines
net/ipv6/route.c +2 -3
 		m = 0; /* lowest valid score */
 	} else if (m < 0) {
+		if (strict & RT6_LOOKUP_F_REACHABLE)
+			rt6_probe(rt);
 		goto out;
 	}
 
-	if (strict & RT6_LOOKUP_F_REACHABLE)
-		rt6_probe(rt);
-

I don't think this is correct. m < 0 are the routers we really don't want to use, e.g. because we get a failure signaled from rt6_check_dev. E.g. we want to query a route where a specified interface id is given.

In case router preference is enabled we mostly give back RT6_NUD_SUCCEED for routes which are somewhat reachable. Really broken routers in NUD_FAILED state are waiting for cleanup and recreation. We also do not accept new NAs on neighbours in NUD_FAILED state IIRC.

Greetings,

Hannes