From 9713497ff4613ca980712cc35db1691f93fd43a7 Mon Sep 17 00:00:00 2001 From: Donald Sharp Date: Tue, 27 Mar 2018 09:13:07 -0400 Subject: [PATCH] zebra: Properly deregister static nexthops There were a few cases where we were not properly de-registering the static nexthops passed to us. This was important when the static route was being removed for whatever reason that we did not leave slag for the nexthop tracking. Signed-off-by: Donald Sharp --- zebra/zebra_rib.c | 4 ++-- zebra/zebra_static.c | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/zebra/zebra_rib.c b/zebra/zebra_rib.c index 69cd6697d2..0c87e7efce 100644 --- a/zebra/zebra_rib.c +++ b/zebra/zebra_rib.c @@ -2121,8 +2121,8 @@ void rib_unlink(struct route_node *rn, struct route_entry *re) /* free RE and nexthops */ if (re->type == ZEBRA_ROUTE_STATIC) - zebra_deregister_rnh_static_nexthops(re->vrf_id, re->ng.nexthop, - rn); + zebra_deregister_rnh_static_nexthops(re->ng.nexthop->vrf_id, + re->ng.nexthop, rn); nexthops_free(re->ng.nexthop); XFREE(MTYPE_RE, re); } diff --git a/zebra/zebra_static.c b/zebra/zebra_static.c index f3921790a6..9edfbef239 100644 --- a/zebra/zebra_static.c +++ b/zebra/zebra_static.c @@ -369,7 +369,7 @@ void static_uninstall_route(afi_t afi, safi_t safi, struct prefix *p, nh_p.u.prefix6 = nexthop->gate.ipv6; } route_entry_nexthop_delete(re, nexthop); - zebra_deregister_rnh_static_nh(si->vrf_id, &nh_p, rn); + zebra_deregister_rnh_static_nh(si->nh_vrf_id, &nh_p, rn); nexthop_free(nexthop); } /* Unlock node. */ -- 2.39.5