pim6d: fix clear ipv6 mroute

Signed-off-by: Sarita Patra <saritap@vmware.com>
This commit is contained in:
Sarita Patra 2022-07-07 08:03:45 -07:00
parent 3aa7d2b2c4
commit 4459f499c4
3 changed files with 24 additions and 0 deletions

View File

@ -2280,6 +2280,22 @@ void gm_ifp_update(struct interface *ifp)
}
}
void gm_group_delete(struct gm_if *gm_ifp)
{
struct gm_sg *sg, *sg_start;
sg_start = gm_sgs_first(gm_ifp->sgs);
/* clean up all mld groups */
frr_each_from (gm_sgs, gm_ifp->sgs, sg, sg_start) {
THREAD_OFF(sg->t_sg_expire);
if (sg->oil)
pim_channel_oil_del(sg->oil, __func__);
gm_sgs_del(gm_ifp->sgs, sg);
gm_sg_free(sg);
}
}
/*
* CLI (show commands only)
*/

View File

@ -352,6 +352,7 @@ struct gm_if {
#if PIM_IPV == 6
extern void gm_ifp_update(struct interface *ifp);
extern void gm_ifp_teardown(struct interface *ifp);
extern void gm_group_delete(struct gm_if *gm_ifp);
#else
static inline void gm_ifp_update(struct interface *ifp)
{

View File

@ -56,6 +56,7 @@
#include "pim_addr.h"
#include "pim_static.h"
#include "pim_util.h"
#include "pim6_mld.h"
/**
* Get current node VRF name.
@ -3994,6 +3995,12 @@ void clear_mroute(struct pim_instance *pim)
igmp_group_delete(grp);
}
}
#else
struct gm_if *gm_ifp;
gm_ifp = pim_ifp->mld;
if (gm_ifp)
gm_group_delete(gm_ifp);
#endif
}