From: Donald Sharp Date: Tue, 27 Mar 2018 13:13:07 +0000 (-0400) Subject: zebra: Properly deregister static nexthops X-Git-Tag: frr-5.0-dev~67^2~4 X-Git-Url: https://git.puffer.fish/?a=commitdiff_plain;h=9713497ff4613ca980712cc35db1691f93fd43a7;p=matthieu%2Ffrr.git 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 --- 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. */