[PATCH] Netlink: Propagate ecmp nexthop weight to kernel for inet6 routes
dxld at darkboxed.org
dxld at darkboxed.org
Sun May 22 22:28:12 CEST 2022
After looking at this more I realise now how bird is splitting multiple
ipv6 nexthops into sequences of route updates for the same prefix.
Consequently the code doing this should also be removed. Though it seems it
works just fine either way but I get errors for the (now redundant) route
removals.
Are we even OK with raising the kernel version required or should I try to
preserve support for the old kernel interface?
--Daniel
On Sun, May 22, 2022 at 08:16:35PM +0200, Daniel Gröber wrote:
> Previously nl_send_route would use plain nl_add_nexthop for ecmp ipv6
> routes instead of adding RTA_MULTIPATH objects via nl_add_multipath. The
> former lacks support for the rtnh_hops field needed for setting the nexthop
> weight though.
>
> On the kernel side support for nexthop weights was introduced by commit
> 398958ae48 ("ipv6: Add support for non-equal-cost multipath") which landed
> in 4.16. Before this the weight will simply be ignored. Support for the
> ipv6 RTA_MULTIPATH attribute was added in 51ebd31815 ("ipv6: add support of
> equal cost multipath (ECMP)") which landed in 3.10. If this version bound
> isn't met installing the route will fail.
> ---
> sysdep/linux/netlink.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/sysdep/linux/netlink.c b/sysdep/linux/netlink.c
> index 29b744cb..5e0b036d 100644
> --- a/sysdep/linux/netlink.c
> +++ b/sysdep/linux/netlink.c
> @@ -1446,7 +1446,7 @@ dest:
> {
> case RTD_UNICAST:
> r->r.rtm_type = RTN_UNICAST;
> - if (nh->next && !krt_ecmp6(p))
> + if (nh->next)
> nl_add_multipath(&r->h, rsize, nh, p->af, eattrs);
> else
> {
> --
> 2.30.2
>
More information about the Bird-users
mailing list