diff options
| author | Don Slice <dslice@cumulusnetworks.com> | 2020-03-10 10:57:30 +0000 |
|---|---|---|
| committer | Don Slice <dslice@cumulusnetworks.com> | 2020-03-10 11:07:14 +0000 |
| commit | 5a7aea851d7e5329b9d24e74614b005d0b4efbef (patch) | |
| tree | b4d96f500b87d479f79d92f68940becd78806cba | |
| parent | e14175b8a1e2eec1d610933aeb625cb2f0fa0385 (diff) | |
zebra: delete ipv6 RA prefix entries when zebra is killed
Memory leak found where ipv6 global prefixes added to the router
advertisement prefix lists were not deleted when the process was
killed.
Signed-off-by: Don Slice <dslice@cumulusnetworks.com>
| -rw-r--r-- | zebra/rtadv.c | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/zebra/rtadv.c b/zebra/rtadv.c index 4b7fd5060a..60ac471b5a 100644 --- a/zebra/rtadv.c +++ b/zebra/rtadv.c @@ -1118,18 +1118,31 @@ void rtadv_stop_ra(struct interface *ifp) } /* - * send router lifetime value of zero in RAs on all interfaces since we're + * Send router lifetime value of zero in RAs on all interfaces since we're * ceasing to advertise globally and want to let all of our neighbors know * RFC 4861 secion 6.2.5 + * + * Delete all ipv6 global prefixes added to the router advertisement prefix + * lists prior to ceasing. */ void rtadv_stop_ra_all(void) { struct vrf *vrf; struct interface *ifp; + struct listnode *node, *nnode; + struct zebra_if *zif; + struct rtadv_prefix *rprefix; RB_FOREACH (vrf, vrf_name_head, &vrfs_by_name) - FOR_ALL_INTERFACES (vrf, ifp) + FOR_ALL_INTERFACES (vrf, ifp) { + zif = ifp->info; + + for (ALL_LIST_ELEMENTS(zif->rtadv.AdvPrefixList, + node, nnode, rprefix)) + rtadv_prefix_reset(zif, rprefix); + rtadv_stop_ra(ifp); + } } void zebra_interface_radv_disable(ZAPI_HANDLER_ARGS) |
