Commit 4c9bcd11 authored by David Ahern's avatar David Ahern Committed by David S. Miller
Browse files

net: Fix nexthop lookups

Andreas reported breakage adding routes with local nexthops:
$ ip route show table main
... dev vnf-xe1p0  proto kernel  scope link  src

$ ip route add via table 100 dev vnf-xe1p0
RTNETLINK answers: Resource temporarily unavailable

3bfd8472 changed the lookup to use the passed in table but for cases like
this the nexthop is in the local table rather than the passed in table.

Fixes: 3bfd8472

 ("net: Use passed in table for nexthop lookups")
Reported-by: default avatarAndreas Schultz <>
Signed-off-by: default avatarDavid Ahern <>
Signed-off-by: default avatarDavid S. Miller <>
parent eb4cb851
......@@ -712,9 +712,16 @@ static int fib_check_nh(struct fib_config *cfg, struct fib_info *fi,
err = fib_table_lookup(tbl, &fl4, &res,
/* on error or if no table given do full lookup. This
* is needed for example when nexthops are in the local
* table rather than the given table
if (!tbl || err) {
err = fib_lookup(net, &fl4, &res,
if (err) {
return err;
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment