]> git.proxmox.com Git - mirror_frr.git/commitdiff
zebra: resolve issue with rnh not evaluating nexhops correctly
authorDon Slice <dslice@cumulusnetworks.com>
Wed, 19 Jun 2019 11:22:21 +0000 (11:22 +0000)
committerDon Slice <dslice@cumulusnetworks.com>
Wed, 19 Jun 2019 14:06:32 +0000 (07:06 -0700)
Problem discovered in testing that occasionally when an interface
address was flushed, the corresponding route would be removed from
the kernel and zebra but remain in the bgp table and be advertised
to peers.  Discovered that when zebra_rib_evaluate_nexthops spun
thru the tree list of rns, if the timing and circumstances were
right, it would move elements and miss evaluating some.  Changed
from frr_each to frr_each_safe and the problem is now gone.

Ticket: CM-25301
Signed-off-by: Don Slice <dslice@cumulusnetworks.com>
zebra/zebra_rib.c

index 61645f95f969a3a452f9f49463255ff187139340..555bec95937bfa5716037b181e8af59606a7539f 100644 (file)
@@ -761,7 +761,7 @@ void zebra_rib_evaluate_rn_nexthops(struct route_node *rn, uint32_t seq)
                 * nht resolution and as such we need to call the
                 * nexthop tracking evaluation code
                 */
-               frr_each (rnh_list, &dest->nht, rnh) {
+               frr_each_safe(rnh_list, &dest->nht, rnh) {
                        struct zebra_vrf *zvrf =
                                zebra_vrf_lookup_by_id(rnh->vrf_id);
                        struct prefix *p = &rnh->node->p;