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
This commit is contained in:
vivek 2016-11-10 18:49:43 -08:00 committed by Donald Sharp
parent f7c62e11d6
commit 7b25dca6b7

View File

@ -1633,7 +1633,7 @@ rib_process (struct route_node *rn)
if (IS_ZEBRA_DEBUG_RIB_DETAILED) if (IS_ZEBRA_DEBUG_RIB_DETAILED)
zlog_debug ("%u:%s/%d: Processing rn %p", vrf_id, buf, rn->p.prefixlen, rn); 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) if (IS_ZEBRA_DEBUG_RIB_DETAILED)
zlog_debug ("%u:%s/%d: Examine rib %p (type %d) status %x flags %x " zlog_debug ("%u:%s/%d: Examine rib %p (type %d) status %x flags %x "