diff --git a/pimd/pim6_mld.c b/pimd/pim6_mld.c index 20ef9216a9c9..ecfe2c85a060 100644 --- a/pimd/pim6_mld.c +++ b/pimd/pim6_mld.c @@ -2151,6 +2151,15 @@ static void gm_start(struct interface *ifp) } } +void pim_gm_if_reset(struct interface *ifp) +{ + struct pim_interface *pim_ifp = ifp->info; + struct gm_if *gm_ifp = pim_ifp->mld; + + if (gm_ifp) + gm_group_delete(gm_ifp); +} + void gm_group_delete(struct gm_if *gm_ifp) { struct gm_sg *sg; diff --git a/pimd/pim6_mld.h b/pimd/pim6_mld.h index 183ab2fc508d..f8d7dafece93 100644 --- a/pimd/pim6_mld.h +++ b/pimd/pim6_mld.h @@ -357,6 +357,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 pim_gm_if_reset(struct interface *ifp); extern void gm_group_delete(struct gm_if *gm_ifp); #else static inline void gm_ifp_update(struct interface *ifp) diff --git a/pimd/pim_ifchannel.c b/pimd/pim_ifchannel.c index da5518994193..0d6625e5b03b 100644 --- a/pimd/pim_ifchannel.c +++ b/pimd/pim_ifchannel.c @@ -1232,8 +1232,6 @@ void pim_ifchannel_local_membership_del(struct interface *ifp, pim_sgaddr *sg) pim_ifp = ifp->info; if (!pim_ifp) return; - if (!pim_ifp->pim_enable) - return; orig = ch = pim_ifchannel_find(ifp, sg); if (!ch) diff --git a/pimd/pim_pim.c b/pimd/pim_pim.c index a4c9178bb9fc..7d59a5aa0539 100644 --- a/pimd/pim_pim.c +++ b/pimd/pim_pim.c @@ -29,6 +29,7 @@ #include "pim_register.h" #include "pim_errors.h" #include "pim_bsm.h" +#include "pim6_mld.h" #include static void on_pim_hello_send(struct event *t); @@ -102,6 +103,8 @@ static void sock_close(struct interface *ifp) void pim_sock_delete(struct interface *ifp, const char *delete_message) { + struct pim_interface *pim_ifp = ifp->info; + zlog_info("PIM INTERFACE DOWN: on interface %s: %s", ifp->name, delete_message); @@ -124,6 +127,9 @@ void pim_sock_delete(struct interface *ifp, const char *delete_message) pim_neighbor_delete_all(ifp, delete_message); sock_close(ifp); + + if (pim_ifp->gm_enable) + pim_gm_if_reset(ifp); } /* For now check dst address for hello, assrt and join/prune is all pim rtr */