ipv4: Set nexthop flags in a more consistent way
Subsystems (3)
PATCH 1/1 ipv4: Set nexthop flags in a more consistent way
From: Ido Schimmel <[email protected]>
Be more consistent about the way in which the nexthop flags are set and set them in one go.
Suggested-by Jakub Kicinski <[email protected]>
Signed-off-by Ido Schimmel <[email protected]>
---RTNH_F_DEAD and RTNH_F_LINKDOWN are set separately above, so I decided to keep them as-is.
--- net/ipv4/fib_semantics.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-)
net/ipv4/fib_semantics.c +2 -5
@@ -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))
Signature · 1 line
2.26.2
Quoted 5 lines · Ido Schimmel
From: Ido Schimmel <[email protected]>
Be more consistent about the way in which the nexthop flags are set and set them in one go.
Quoted 9 lines
Suggested-by Jakub Kicinski <[email protected]>Signed-off-by Ido Schimmel <[email protected]>---
RTNH_F_DEADandRTNH_F_LINKDOWNare set separately above, so I decided to keep them as-is.--- net/ipv4/fib_semantics.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-)
Reviewed-by David Ahern <[email protected]>
Quoted 10 lines · On Tue, 10 Nov 2020 08:25:50 -0700 David Ahern wrote:
Quoted 7 lines · Ido Schimmel
From: Ido Schimmel <[email protected]>
Be more consistent about the way in which the nexthop flags are set and set them in one go.
Suggested-by Jakub Kicinski <[email protected]>Signed-off-by Ido Schimmel <[email protected]>Reviewed-by David Ahern <[email protected]>
Applied, thanks!