aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMartin KaFai Lau <kafai@fb.com>2015-01-20 22:16:02 -0500
committerDavid S. Miller <davem@davemloft.net>2015-01-26 01:09:51 -0500
commitb0a1ba59921eaaa9cb8f97bb35f2e6870fcdfedc (patch)
tree5db7467e7b5ff0163499cb807a8835642190245e
parent24df8986f36b9a5d8ae08236498d92267bac454b (diff)
ipv6: Fix __ip6_route_redirect
In my last commit (a3c00e4: ipv6: Remove BACKTRACK macro), the changes in __ip6_route_redirect is incorrect. The following case is missed: 1. The for loop tries to find a valid gateway rt. If it fails to find one, rt will be NULL. 2. When rt is NULL, it is set to the ip6_null_entry. 3. The newly added 'else if', from a3c00e4, will stop the backtrack from happening. Signed-off-by: Martin KaFai Lau <kafai@fb.com> Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r--net/ipv6/route.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/net/ipv6/route.c b/net/ipv6/route.c
index 166e33bed222..495965358d22 100644
--- a/net/ipv6/route.c
+++ b/net/ipv6/route.c
@@ -1242,12 +1242,16 @@ restart:
1242 rt = net->ipv6.ip6_null_entry; 1242 rt = net->ipv6.ip6_null_entry;
1243 else if (rt->dst.error) { 1243 else if (rt->dst.error) {
1244 rt = net->ipv6.ip6_null_entry; 1244 rt = net->ipv6.ip6_null_entry;
1245 } else if (rt == net->ipv6.ip6_null_entry) { 1245 goto out;
1246 }
1247
1248 if (rt == net->ipv6.ip6_null_entry) {
1246 fn = fib6_backtrack(fn, &fl6->saddr); 1249 fn = fib6_backtrack(fn, &fl6->saddr);
1247 if (fn) 1250 if (fn)
1248 goto restart; 1251 goto restart;
1249 } 1252 }
1250 1253
1254out:
1251 dst_hold(&rt->dst); 1255 dst_hold(&rt->dst);
1252 1256
1253 read_unlock_bh(&table->tb6_lock); 1257 read_unlock_bh(&table->tb6_lock);