From 1d341d461e8549524f9054534fb20cec7b7c967d Mon Sep 17 00:00:00 2001 From: David Lamparter Date: Mon, 27 Jan 2025 17:57:15 +0100 Subject: [PATCH] zebra: install dst-src routes without NHG The Linux kernel doesn't support dst-src routes with NHGs as nexthop, for some (rather dubious) caching reasons. Signed-off-by: David Lamparter --- zebra/rt_netlink.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/zebra/rt_netlink.c b/zebra/rt_netlink.c index b32882e858..d696b19859 100644 --- a/zebra/rt_netlink.c +++ b/zebra/rt_netlink.c @@ -2588,10 +2588,10 @@ ssize_t netlink_route_multipath_msg_encode(int cmd, struct zebra_dplane_ctx *ctx } } - if ((!fpm && kernel_nexthops_supported() - && (!proto_nexthops_only() - || is_proto_nhg(dplane_ctx_get_nhe_id(ctx), 0))) - || (fpm && force_nhg)) { + if ((!fpm && kernel_nexthops_supported() && + (!proto_nexthops_only() || is_proto_nhg(dplane_ctx_get_nhe_id(ctx), 0)) && + (!src_p || !src_p->prefixlen)) || + (fpm && force_nhg)) { /* Kernel supports nexthop objects */ if (IS_ZEBRA_DEBUG_KERNEL) zlog_debug("%s: %pFX nhg_id is %u", __func__, p, -- 2.39.5