diff options
author | Ido Schimmel <idosch@nvidia.com> | 2020-11-10 12:25:53 +0200 |
---|---|---|
committer | Jakub Kicinski <kuba@kernel.org> | 2020-11-11 17:45:55 -0800 |
commit | ca787e0b935cdb45db1715f724d859683c5de297 (patch) | |
tree | 3c8e4ae364b4e7f47adcb29ff329e52010aa8ad4 /net | |
parent | 0575bedd6a1575e3f585b5dd5621cdcd26978054 (diff) | |
download | linux-ca787e0b935cdb45db1715f724d859683c5de297.tar.bz2 |
ipv4: Set nexthop flags in a more consistent way
Be more consistent about the way in which the nexthop flags are set and
set them in one go.
Suggested-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Ido Schimmel <idosch@nvidia.com>
Reviewed-by: David Ahern <dsahern@kernel.org>
Link: https://lore.kernel.org/r/20201110102553.1924232-1-idosch@idosch.org
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'net')
-rw-r--r-- | net/ipv4/fib_semantics.c | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/net/ipv4/fib_semantics.c b/net/ipv4/fib_semantics.c index f70b9a0c4957..7612ff6111a7 100644 --- a/net/ipv4/fib_semantics.c +++ b/net/ipv4/fib_semantics.c @@ -1641,11 +1641,8 @@ int fib_nexthop_info(struct sk_buff *skb, const struct fib_nh_common *nhc, break; } - *flags |= (nhc->nhc_flags & RTNH_F_ONLINK); - if (nhc->nhc_flags & RTNH_F_OFFLOAD) - *flags |= RTNH_F_OFFLOAD; - if (nhc->nhc_flags & RTNH_F_TRAP) - *flags |= RTNH_F_TRAP; + *flags |= (nhc->nhc_flags & + (RTNH_F_ONLINK | RTNH_F_OFFLOAD | RTNH_F_TRAP)); if (!skip_oif && nhc->nhc_dev && nla_put_u32(skb, RTA_OIF, nhc->nhc_dev->ifindex)) |