]> git.puffer.fish Git - matthieu/frr.git/commitdiff
zebra: fix rnh deleting nht entry
authorDon Slice <dslice@cumulusnetworks.com>
Wed, 21 Feb 2018 18:45:05 +0000 (10:45 -0800)
committerDon Slice <dslice@cumulusnetworks.com>
Wed, 21 Feb 2018 18:47:21 +0000 (10:47 -0800)
Problem seen when a prefix was learned with nexthops from multiple
route sources (static and ospf in this case) and the link to that
nexthop flaps.  The nht entry was incorrectly deleted so when the
link came back up the static was not re-installed correctly.

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

index 967bc92850cb9d5282adf670fd15dc26ac77f009..c134028b9c5e1804a2a2e6df9ed593e7294d64b1 100644 (file)
@@ -416,8 +416,6 @@ static int nexthop_active(afi_t afi, struct route_entry *re,
 
        if (set) {
                UNSET_FLAG(nexthop->flags, NEXTHOP_FLAG_RECURSIVE);
-               zebra_deregister_rnh_static_nexthops(nexthop->vrf_id,
-                                                    nexthop->resolved, top);
                nexthops_free(nexthop->resolved);
                nexthop->resolved = NULL;
                re->nexthop_mtu = 0;
@@ -2115,7 +2113,9 @@ void rib_unlink(struct route_node *rn, struct route_entry *re)
                dest->selected_fib = NULL;
 
        /* free RE and nexthops */
-       zebra_deregister_rnh_static_nexthops(re->vrf_id, re->nexthop, rn);
+       if (re->type == ZEBRA_ROUTE_STATIC)
+               zebra_deregister_rnh_static_nexthops(re->vrf_id,
+                                                    re->nexthop, rn);
        nexthops_free(re->nexthop);
        XFREE(MTYPE_RE, re);
 }