ipv4: Add fib_nh_common to fib_result
authorDavid Ahern <dsahern@gmail.com>
Tue, 2 Apr 2019 21:11:55 +0000 (14:11 -0700)
committerDavid S. Miller <davem@davemloft.net>
Thu, 4 Apr 2019 04:50:20 +0000 (21:50 -0700)
commiteba618abacade71669eb67c3360eecfee810cc88
treecfc98d4a5fefbcc07d586bcec602a9853bae2aa0
parent0af7e7c128eb33f2dc16ed088ced00675785d628
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>
include/net/ip_fib.h
net/core/filter.c
net/ipv4/fib_frontend.c
net/ipv4/fib_lookup.h
net/ipv4/fib_semantics.c
net/ipv4/fib_trie.c
net/ipv4/route.c