From 7c69a429b7a92819f2718dbe0074a06b626f3633 Mon Sep 17 00:00:00 2001 From: vivek Date: Thu, 10 Nov 2016 18:49:43 -0800 Subject: [PATCH] zebra: Perform safe walk of RIB entries in rib_process() There is a scenario where a RIB entry is unlinked and freed during RIB processing. However, the walk of the entries is not being performed in a safe manner. Fix the code to do this correctly. Signed-off-by: Vivek Venkatraman Ticket: CM-13393 Reviewed By: Trivial Testing Done: Basic manual test --- zebra/zebra_rib.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/zebra/zebra_rib.c b/zebra/zebra_rib.c index c573f6bd5c..1d46289ece 100644 --- a/zebra/zebra_rib.c +++ b/zebra/zebra_rib.c @@ -1633,7 +1633,7 @@ rib_process (struct route_node *rn) if (IS_ZEBRA_DEBUG_RIB_DETAILED) zlog_debug ("%u:%s/%d: Processing rn %p", vrf_id, buf, rn->p.prefixlen, rn); - RNODE_FOREACH_RIB (rn, rib) + RNODE_FOREACH_RIB_SAFE (rn, rib, next) { if (IS_ZEBRA_DEBUG_RIB_DETAILED) zlog_debug ("%u:%s/%d: Examine rib %p (type %d) status %x flags %x " -- 2.39.5