Commit ca787e0b authored by Ido Schimmel's avatar Ido Schimmel Committed by Jakub Kicinski

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: default avatarJakub Kicinski <kuba@kernel.org>
Signed-off-by: default avatarIdo Schimmel <idosch@nvidia.com>
Reviewed-by: default avatarDavid Ahern <dsahern@kernel.org>
Link: https://lore.kernel.org/r/20201110102553.1924232-1-idosch@idosch.orgSigned-off-by: default avatarJakub Kicinski <kuba@kernel.org>
parent 0575bedd
......@@ -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))
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment