diff options
author | David Ahern <dsahern@gmail.com> | 2019-03-27 20:53:52 -0700 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2019-03-29 10:48:03 -0700 |
commit | 2b2450ca4a2d9d772dc45e1220c04cb3ba761843 (patch) | |
tree | f594485a167b35f2d1fb583b821d55b745083d9f /net/core | |
parent | ipv6: Create cleanup helper for fib6_nh (diff) | |
download | linux-dev-2b2450ca4a2d9d772dc45e1220c04cb3ba761843.tar.xz linux-dev-2b2450ca4a2d9d772dc45e1220c04cb3ba761843.zip |
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>
Diffstat (limited to 'net/core')
-rw-r--r-- | net/core/filter.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/net/core/filter.c b/net/core/filter.c index 22eb2edf5573..e7784764213a 100644 --- a/net/core/filter.c +++ b/net/core/filter.c @@ -4751,7 +4751,7 @@ static int bpf_ipv6_fib_lookup(struct net *net, struct bpf_fib_lookup *params, if (f6i->fib6_nh.nh_lwtstate) return BPF_FIB_LKUP_RET_UNSUPP_LWT; - if (f6i->fib6_flags & RTF_GATEWAY) + if (f6i->fib6_nh.fib_nh_has_gw) *dst = f6i->fib6_nh.nh_gw; dev = f6i->fib6_nh.nh_dev; |