ipv6: don't stop backtracking in fib6_lookup_1 if subtree does not match
authorHannes Frederic Sowa <hannes@stressinduktion.org>
Wed, 7 Aug 2013 00:34:31 +0000 (02:34 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 14 Sep 2013 13:54:54 +0000 (06:54 -0700)
commit24e8ac721e0e13cab478bd190977daac48b6146c
treeb7c3f56493b4486c537dc8a8dc3091fd3b00cf27
parentca02d414915693909f9d7f455c4598d3f8b514b3
ipv6: don't stop backtracking in fib6_lookup_1 if subtree does not match

[ Upstream commit 3e3be275851bc6fc90bfdcd732cd95563acd982b ]

In case a subtree did not match we currently stop backtracking and return
NULL (root table from fib_lookup). This could yield in invalid routing
table lookups when using subtrees.

Instead continue to backtrack until a valid subtree or node is found
and return this match.

Also remove unneeded NULL check.

Reported-by: Teco Boot <teco@inf-net.nl>
Cc: YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>
Cc: David Lamparter <equinox@diac24.net>
Cc: <boutier@pps.univ-paris-diderot.fr>
Signed-off-by: Hannes Frederic Sowa <hannes@stressinduktion.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
net/ipv6/ip6_fib.c