Skip to content

Commit 68e2ffd

Browse files
dsaherndavem330
authored andcommitted
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. Fixes: fc1e64e ("net/ipv6: Add support for onlink flag") Signed-off-by: David Ahern <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 6d06673 commit 68e2ffd

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

net/ipv6/route.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4112,6 +4112,7 @@ static int ip6_route_multipath_add(struct fib6_config *cfg,
41124112
r_cfg.fc_encap_type = nla_get_u16(nla);
41134113
}
41144114

4115+
r_cfg.fc_flags |= (rtnh->rtnh_flags & RTNH_F_ONLINK);
41154116
rt = ip6_route_info_create(&r_cfg, extack);
41164117
if (IS_ERR(rt)) {
41174118
err = PTR_ERR(rt);

0 commit comments

Comments
 (0)