From 4a38ab10b92f83a0d8e1dbfc067f4dbe83424dd5 Mon Sep 17 00:00:00 2001 From: harini Date: Wed, 26 Nov 2025 02:45:42 -0800 Subject: [PATCH] zebra: nhg code selection doesnot check invalid status MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Problem description: 1)In some corner cases in zebra, “Failed to enqueue dataplane  install” happened for routes which was caused because of INVALID nhg. 2)Our NHG code logic, check all nexthop entries is valid or not,but it does not check whether the nhg itself is valid or not during our checks which in turn cause route install failures in zebra. Fix: Handled the nhg logic to check for validity during selection. Signed-off-by: harini --- zebra/zebra_rib.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/zebra/zebra_rib.c b/zebra/zebra_rib.c index 0e6f31a76084..c062cff78046 100644 --- a/zebra/zebra_rib.c +++ b/zebra/zebra_rib.c @@ -1379,6 +1379,16 @@ static void rib_process(struct route_node *rn) continue; } } else { + /* + * During interface flap events, we have multiple NHGs + * some with valid and some with invalid flags, skip + * invalid NHGs + */ + if (!re->nhe) + continue; + + if (!CHECK_FLAG(re->nhe->flags, NEXTHOP_GROUP_VALID)) + continue; /* * If the re has not changed and the nhg we have is * not usable, then we cannot use this route entry