]> git.puffer.fish Git - mirror/frr.git/commitdiff
zebra: Perform safe walk of RIB entries in rib_process()
authorvivek <vivek@cumulusnetworks.com>
Fri, 11 Nov 2016 02:49:43 +0000 (18:49 -0800)
committerDonald Sharp <sharpd@cumulusnetworks.com>
Thu, 22 Dec 2016 01:26:15 +0000 (20:26 -0500)
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

zebra/zebra_rib.c

index c573f6bd5c04212346f16bb8a239b006dec1404f..1d46289ecea727d354775c354f19de304d913894 100644 (file)
@@ -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 "