ipv4: Change fib_nexthop_info and fib_add_nexthop to take fib_nh_common
authorDavid Ahern <dsahern@gmail.com>
Tue, 2 Apr 2019 21:11:57 +0000 (14:11 -0700)
committerDavid S. Miller <davem@davemloft.net>
Thu, 4 Apr 2019 04:50:20 +0000 (21:50 -0700)
commitc236419981224d37a5d0a6e7781f73479d4a030e
treea6d42c3229296dd4ae8096892d174b7416f55d01
parentb0f60193632e4eab4c9663101bb435dd7bc27ae8
ipv4: Change fib_nexthop_info and fib_add_nexthop to take fib_nh_common

With the exception of the nexthop weight, the nexthop attributes used by
fib_nexthop_info and fib_add_nexthop come from the fib_nh_common struct.
Update both to use it and change fib_nexthop_info to check the family
as needed.

nexthop weight comes from the common struct for existing use cases, but
for nexthop groups the weight is outside of the fib_nh_common to allow
the same nexthop definition to be used in multiple groups with different
weights.

Signed-off-by: David Ahern <dsahern@gmail.com>
Acked-by: Martin KaFai Lau <kafai@fb.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/ipv4/fib_semantics.c