diff options
author | David Ahern <dsahern@gmail.com> | 2019-04-02 14:11:55 -0700 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2019-04-03 21:50:20 -0700 |
commit | eba618abacade71669eb67c3360eecfee810cc88 (patch) | |
tree | cfc98d4a5fefbcc07d586bcec602a9853bae2aa0 /net/ipv4/fib_lookup.h | |
parent | 0af7e7c128eb33f2dc16ed088ced00675785d628 (diff) | |
download | linux-eba618abacade71669eb67c3360eecfee810cc88.tar.gz linux-eba618abacade71669eb67c3360eecfee810cc88.tar.bz2 linux-eba618abacade71669eb67c3360eecfee810cc88.zip |
ipv4: Add fib_nh_common to fib_result
Most of the ipv4 code only needs data from fib_nh_common. Add
fib_nh_common selection to fib_result and update users to use it.
Right now, fib_nh_common in fib_result will point to a fib_nh struct
that is embedded within a fib_info:
fib_info --> fib_nh
fib_nh
...
fib_nh
^
fib_result->nhc ----+
Later, nhc can point to a fib_nh within a nexthop struct:
fib_info --> nexthop --> fib_nh
^
fib_result->nhc ---------------+
or for a nexthop group:
fib_info --> nexthop --> nexthop --> fib_nh
nexthop --> fib_nh
...
nexthop --> fib_nh
^
fib_result->nhc ---------------------------+
In all cases nhsel within fib_result will point to which leg in the
multipath route is used.
Signed-off-by: David Ahern <dsahern@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv4/fib_lookup.h')
-rw-r--r-- | net/ipv4/fib_lookup.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/net/ipv4/fib_lookup.h b/net/ipv4/fib_lookup.h index e6ff282bb7f4..7945f0534db7 100644 --- a/net/ipv4/fib_lookup.h +++ b/net/ipv4/fib_lookup.h @@ -45,6 +45,7 @@ static inline void fib_result_assign(struct fib_result *res, { /* we used to play games with refcounts, but we now use RCU */ res->fi = fi; + res->nhc = fib_info_nhc(fi, 0); } struct fib_prop { |