From 59ab767c0b22d110df25b8acb4efadc4d13245fa Mon Sep 17 00:00:00 2001 From: Philippe Guibert Date: Tue, 28 Nov 2023 17:03:58 +0100 Subject: [PATCH] zebra: add support for redistributed routes with nexthop groups Signed-off-by: Philippe Guibert --- zebra/zapi_msg.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/zebra/zapi_msg.c b/zebra/zapi_msg.c index d357c33e08ce..ae9b0ec7333a 100644 --- a/zebra/zapi_msg.c +++ b/zebra/zapi_msg.c @@ -515,7 +515,16 @@ static int zsend_redistribute_route_nhg(const struct nexthop_group *nhg, struct nexthop *nexthop; struct zapi_nexthop *api_nh; int count = 0; + struct nexthop_group_id *nhgid; + if (CHECK_FLAG(nhg->flags, NEXTHOP_GROUP_TYPE_GROUP)) { + for (nhgid = nhg->group; nhgid; nhgid = nhgid->next) { + if (nhgid->nhg) + count += zsend_redistribute_route_nhg(nhgid->nhg, + api); + } + return count; + } for (nexthop = nhg->nexthop; nexthop; nexthop = nexthop->next) { if (!CHECK_FLAG(nexthop->flags, NEXTHOP_FLAG_ACTIVE)) continue;