Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pim, pimv6: Removing upstreams and mroutes when pim configs removed on receiver connected interface. #14229

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions pimd/pim6_mld.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
1 change: 1 addition & 0 deletions pimd/pim6_mld.h
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
5 changes: 4 additions & 1 deletion pimd/pim_iface.c
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ void pim_if_delete(struct interface *ifp)

pim_if_del_vif(ifp);

pim_igmp_if_fini(pim_ifp);
pim_igmp_if_fini(ifp);

list_delete(&pim_ifp->pim_neighbor_list);
list_delete(&pim_ifp->upstream_switch_list);
Expand Down Expand Up @@ -1808,6 +1808,9 @@ void pim_pim_interface_delete(struct interface *ifp)
pim_sock_delete(ifp, "pim unconfigured on interface");
pim_upstream_nh_if_update(pim_ifp->pim, ifp);

if (pim_ifp->gm_enable)
pim_gm_if_reset(ifp);

if (!pim_ifp->gm_enable) {
pim_if_addr_del_all(ifp);
pim_if_delete(ifp);
Expand Down
2 changes: 0 additions & 2 deletions pimd/pim_ifchannel.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
13 changes: 9 additions & 4 deletions pimd/pim_igmp.c
Original file line number Diff line number Diff line change
Expand Up @@ -1074,18 +1074,20 @@ void igmp_sock_free(struct gm_sock *igmp)

void igmp_sock_delete(struct gm_sock *igmp)
{
struct interface *ifp;
struct pim_interface *pim_ifp;

sock_close(igmp);

ifp = igmp->interface;
pim_ifp = igmp->interface->info;

listnode_delete(pim_ifp->gm_socket_list, igmp);

igmp_sock_free(igmp);

if (!listcount(pim_ifp->gm_socket_list))
pim_igmp_if_reset(pim_ifp);
pim_gm_if_reset(ifp);
}

void igmp_sock_delete_all(struct interface *ifp)
Expand Down Expand Up @@ -1135,8 +1137,9 @@ void pim_igmp_if_init(struct pim_interface *pim_ifp, struct interface *ifp)
igmp_group_hash_equal, hash_name);
}

void pim_igmp_if_reset(struct pim_interface *pim_ifp)
void pim_gm_if_reset(struct interface *ifp)
{
struct pim_interface *pim_ifp = ifp->info;
struct listnode *grp_node, *grp_nextnode;
struct gm_group *grp;

Expand All @@ -1146,9 +1149,11 @@ void pim_igmp_if_reset(struct pim_interface *pim_ifp)
}
}

void pim_igmp_if_fini(struct pim_interface *pim_ifp)
void pim_igmp_if_fini(struct interface *ifp)
{
pim_igmp_if_reset(pim_ifp);
struct pim_interface *pim_ifp = ifp->info;

pim_gm_if_reset(ifp);

assert(pim_ifp->gm_group_list);
assert(!listcount(pim_ifp->gm_group_list));
Expand Down
6 changes: 3 additions & 3 deletions pimd/pim_igmp.h
Original file line number Diff line number Diff line change
Expand Up @@ -82,8 +82,8 @@ struct pim_interface;

#if PIM_IPV == 4
void pim_igmp_if_init(struct pim_interface *pim_ifp, struct interface *ifp);
void pim_igmp_if_reset(struct pim_interface *pim_ifp);
void pim_igmp_if_fini(struct pim_interface *pim_ifp);
void pim_gm_if_reset(struct interface *ifp);
void pim_igmp_if_fini(struct interface *ifp);

struct gm_sock *pim_igmp_sock_lookup_ifaddr(struct list *igmp_sock_list,
struct in_addr ifaddr);
Expand All @@ -108,7 +108,7 @@ static inline void pim_igmp_if_init(struct pim_interface *pim_ifp,
{
}

static inline void pim_igmp_if_fini(struct pim_interface *pim_ifp)
static inline void pim_igmp_if_fini(struct interface *ifp)
{
}

Expand Down
Loading