From 6d0a6ede82d7e02581c4fb9f585239d2358bd45e Mon Sep 17 00:00:00 2001 From: Mobashshera Rasool Date: Tue, 22 Mar 2022 10:48:01 -0700 Subject: [PATCH] pimd: correct prefix-list ssm range update for exclude mode Modifying the code as per RFC 4604 section 2.2.1 EXCLUDE mode does not apply to SSM addresses, and an SSM-aware router will ignore MODE_IS_EXCLUDE and CHANGE_TO_EXCLUDE_MODE requests in the SSM range. Issue is observed when a group in exclude mode was in ASM range as per the prefix-list and then prefix-list is modified to make it fall under SSM range. The (*,G) entry remains there. So when the group moves to ssm range and it is exclude mode, delete the group from the IGMP table. Co-authored-by: Vishal Dhingra Signed-off-by: Mobashshera Rasool --- pimd/pim_igmp.c | 27 +++++++++++++++++++++------ 1 file changed, 21 insertions(+), 6 deletions(-) diff --git a/pimd/pim_igmp.c b/pimd/pim_igmp.c index aa6b30c624..57c4cdc470 100644 --- a/pimd/pim_igmp.c +++ b/pimd/pim_igmp.c @@ -131,12 +131,27 @@ void igmp_source_forward_reevaluate_all(struct pim_instance *pim) struct listnode *srcnode; struct gm_source *src; - /* scan group sources */ - for (ALL_LIST_ELEMENTS_RO(grp->group_source_list, - srcnode, src)) { - igmp_source_forward_reevaluate_one(pim, src); - } /* scan group sources */ - } /* scan igmp groups */ + /* + * RFC 4604 + * section 2.2.1 + * EXCLUDE mode does not apply to SSM addresses, + * and an SSM-aware router will ignore + * MODE_IS_EXCLUDE and CHANGE_TO_EXCLUDE_MODE + * requests in the SSM range. + */ + if (pim_is_grp_ssm(pim, grp->group_addr) && + grp->group_filtermode_isexcl) { + igmp_group_delete(grp); + } else { + /* scan group sources */ + for (ALL_LIST_ELEMENTS_RO( + grp->group_source_list, srcnode, + src)) { + igmp_source_forward_reevaluate_one(pim, + src); + } /* scan group sources */ + } + } /* scan igmp groups */ RB_FOREACH_SAFE (ch, pim_ifchannel_rb, &pim_ifp->ifchannel_rb, ch_temp) {