aboutsummaryrefslogtreecommitdiffstats
path: root/net/ipv6/route.c
diff options
context:
space:
mode:
authorDavid Ahern <dsahern@gmail.com>2019-04-16 14:36:10 -0700
committerDavid S. Miller <davem@davemloft.net>2019-04-17 23:10:47 -0700
commiteffda4dd97e878ab83336bec7411cc41b5cc6d37 (patch)
tree7091d54945d28a89581e4b49aebe816c817340af /net/ipv6/route.c
parentipv6: Pass fib6_result to fib6_table_lookup tracepoint (diff)
downloadlinux-dev-effda4dd97e878ab83336bec7411cc41b5cc6d37.tar.xz
linux-dev-effda4dd97e878ab83336bec7411cc41b5cc6d37.zip
ipv6: Pass fib6_result to fib lookups
Change fib6_lookup and fib6_table_lookup to take a fib6_result and set f6i and nh rather than returning a fib6_info. For now both always return 0. A later patch set can make these more like the IPv4 counterparts and return EINVAL, EACCESS, etc based on fib6_type. Signed-off-by: David Ahern <dsahern@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv6/route.c')
-rw-r--r--net/ipv6/route.c15
1 files changed, 7 insertions, 8 deletions
diff --git a/net/ipv6/route.c b/net/ipv6/route.c
index 405e0784d13b..5a1e1176c33c 100644
--- a/net/ipv6/route.c
+++ b/net/ipv6/route.c
@@ -1839,11 +1839,10 @@ void rt6_age_exceptions(struct fib6_info *rt,
}
/* must be called with rcu lock held */
-struct fib6_info *fib6_table_lookup(struct net *net, struct fib6_table *table,
- int oif, struct flowi6 *fl6, int strict)
+int fib6_table_lookup(struct net *net, struct fib6_table *table, int oif,
+ struct flowi6 *fl6, struct fib6_result *res, int strict)
{
struct fib6_node *fn, *saved_fn;
- struct fib6_result res;
fn = fib6_node_lookup(&table->tb6_root, &fl6->daddr, &fl6->saddr);
saved_fn = fn;
@@ -1852,8 +1851,8 @@ struct fib6_info *fib6_table_lookup(struct net *net, struct fib6_table *table,
oif = 0;
redo_rt6_select:
- rt6_select(net, fn, oif, &res, strict);
- if (res.f6i == net->ipv6.fib6_null_entry) {
+ rt6_select(net, fn, oif, res, strict);
+ if (res->f6i == net->ipv6.fib6_null_entry) {
fn = fib6_backtrack(fn, &fl6->saddr);
if (fn)
goto redo_rt6_select;
@@ -1865,9 +1864,9 @@ redo_rt6_select:
}
}
- trace_fib6_table_lookup(net, &res, table, fl6);
+ trace_fib6_table_lookup(net, res, table, fl6);
- return res.f6i;
+ return 0;
}
struct rt6_info *ip6_pol_route(struct net *net, struct fib6_table *table,
@@ -1885,7 +1884,7 @@ struct rt6_info *ip6_pol_route(struct net *net, struct fib6_table *table,
rcu_read_lock();
- res.f6i = fib6_table_lookup(net, table, oif, fl6, strict);
+ fib6_table_lookup(net, table, oif, fl6, &res, strict);
if (res.f6i == net->ipv6.fib6_null_entry) {
rt = net->ipv6.ip6_null_entry;
rcu_read_unlock();