net/ipv6: Handle onlink flag with multipath routes
Subsystems (3)
PATCH v3 1/1 net/ipv6: Handle onlink flag with multipath routes
For multipath routes the ONLINK flag can be specified per nexthop in rtnh_flags or globally in rtm_flags. Update ip6_route_multipath_add to consider the ONLINK setting coming from rtnh_flags. Each loop over nexthops the config for the sibling route is initialized to the global config and then per nexthop settings overlayed. The flag is 'or'ed into fib6_config to handle the ONLINK flag coming from either rtm_flags or rtnh_flags.
---
v3
- no change; resend because patchworks shows v2 as superseded
v2
- updated commit message to reflect flag can be global or per-nexthop and both need to be handled
net/ipv6/route.c | 1 + 1 file changed, 1 insertion(+)
net/ipv6/route.c +1 -0
@@ -4112,6 +4112,7 @@ static int ip6_route_multipath_add(struct fib6_config *cfg, r_cfg.fc_encap_type =nla_get_u16 (nla); } + r_cfg.fc_flags |= (rtnh->rtnh_flags &RTNH_F_ONLINK ); rt =ip6_route_info_create (&r_cfg, extack);if (IS_ERR (rt)) { err =PTR_ERR (rt);
Signature · 1 line
2.11.0
From: David Ahern <[email protected]>
Date: Tue, 20 Mar 2018 10:06:59 -0700
Quoted 10 lines
For multipath routes the ONLINK flag can be specified per nexthop in
rtnh_flagsor globally inrtm_flags. Updateip6_route_multipath_addto consider the ONLINK setting coming fromrtnh_flags. Each loop over nexthops the config for the sibling route is initialized to the global config and then per nexthop settings overlayed. The flag is 'or'ed intofib6_configto handle the ONLINK flag coming from eitherrtm_flagsorrtnh_flags.Fixes fc1e64e1092f ("net/ipv6: Add support for onlink flag")Signed-off-by David Ahern <[email protected]>
Applied, thanks David.