]> git.proxmox.com Git - mirror_frr.git/commitdiff
zebra: Properly deregister static nexthops
authorDonald Sharp <sharpd@cumulusnetworks.com>
Tue, 27 Mar 2018 13:13:07 +0000 (09:13 -0400)
committerDonald Sharp <sharpd@cumulusnetworks.com>
Tue, 27 Mar 2018 19:51:53 +0000 (15:51 -0400)
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 <sharpd@cumulusnetworks.com>
zebra/zebra_rib.c
zebra/zebra_static.c

index 69cd6697d2d96b7c9739d98b85f0b0e174500a83..0c87e7efce3d5c528e911c1868481e0458b00dac 100644 (file)
@@ -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);
 }
index f3921790a6c97e2b24c19c0448a6f98cac4cac6e..9edfbef239691920344b3eb85fc12ae490ddcd17 100644 (file)
@@ -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. */