summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorvivek <vivek@cumulusnetworks.com>2016-11-10 18:49:43 -0800
committerDonald Sharp <sharpd@cumulusnetworks.com>2017-01-17 18:43:35 -0500
commit7b25dca6b7d599f5e885b21ed40dc0fb418c4bcc (patch)
tree1a580a0512dd44676dc5818ee1c49683ca6e7c25
parentf7c62e11d6f4284ef3471645f2e2a986b8301a18 (diff)
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 <vivek@cumulusnetworks.com> Ticket: CM-13393 Reviewed By: Trivial Testing Done: Basic manual test
-rw-r--r--zebra/zebra_rib.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/zebra/zebra_rib.c b/zebra/zebra_rib.c
index e48da0479b..59893b1a0f 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 "