summaryrefslogtreecommitdiff
path: root/zebra/zebra_rib.c
diff options
context:
space:
mode:
authorDon Slice <dslice@cumulusnetworks.com>2018-02-21 10:45:05 -0800
committerDon Slice <dslice@cumulusnetworks.com>2018-02-21 10:47:21 -0800
commitb43444f53a3c21e116c66fd66fb776ffcb727205 (patch)
tree1430bf2e47f63395592a6e33d5430fe02cf20769 /zebra/zebra_rib.c
parent4298f5e937a1fa689047697395f8b741fb9b3d15 (diff)
zebra: fix rnh deleting nht entry
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>
Diffstat (limited to 'zebra/zebra_rib.c')
-rw-r--r--zebra/zebra_rib.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/zebra/zebra_rib.c b/zebra/zebra_rib.c
index 967bc92850..c134028b9c 100644
--- a/zebra/zebra_rib.c
+++ b/zebra/zebra_rib.c
@@ -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);
}