ipv6: Move gateway checks to a fib6_nh setting
authorDavid Ahern <dsahern@gmail.com>
Thu, 28 Mar 2019 03:53:52 +0000 (20:53 -0700)
committerDavid S. Miller <davem@davemloft.net>
Fri, 29 Mar 2019 17:48:03 +0000 (10:48 -0700)
commit2b2450ca4a2d9d772dc45e1220c04cb3ba761843
treef594485a167b35f2d1fb583b821d55b745083d9f
parentdac7d0f27075ce54017a7efdd6ae0a55352a0f80
ipv6: Move gateway checks to a fib6_nh setting

The gateway setting is not per fib6_info entry but per-fib6_nh. Add a new
fib_nh_has_gw flag to fib6_nh and convert references to RTF_GATEWAY to
the new flag. For IPv6 address the flag is cheaper than checking that
nh_gw is non-0 like IPv4 does.

While this increases fib6_nh by 8-bytes, the effective allocation size of
a fib6_info is unchanged. The 8 bytes is recovered later with a
fib_nh_common change.

Signed-off-by: David Ahern <dsahern@gmail.com>
Reviewed-by: Ido Schimmel <idosch@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
include/net/ip6_fib.h
include/net/ip6_route.h
net/core/filter.c
net/ipv6/addrconf.c
net/ipv6/ip6_fib.c
net/ipv6/route.c