Skip to content

Commit

Permalink
pimd: Modifying members of pim_instance to accommodate IPv6 changes
Browse files Browse the repository at this point in the history
Modifying the members of pim_instance which are to be used
for both IPv4 and IPv6 to common names(for both MLD and IGMP).

Issue: FRRouting#10023

Co-authored-by: Mobashshera Rasool <[email protected]>
Co-authored-by: Sarita Patra <[email protected]>
Signed-off-by: Abhishek N R <[email protected]>
  • Loading branch information
3 people committed Dec 16, 2021
1 parent ad1229a commit 9c8c6ad
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 17 deletions.
14 changes: 7 additions & 7 deletions pimd/pim_cmd.c
Original file line number Diff line number Diff line change
Expand Up @@ -3407,14 +3407,14 @@ static void igmp_show_groups(struct pim_instance *pim, struct vty *vty, bool uj)

if (uj) {
json = json_object_new_object();
json_object_int_add(json, "totalGroups", pim->igmp_group_count);
json_object_int_add(json, "totalGroups", pim->gm_group_count);
json_object_int_add(json, "watermarkLimit",
pim->igmp_watermark_limit);
pim->gm_watermark_limit);
} else {
vty_out(vty, "Total IGMP groups: %u\n", pim->igmp_group_count);
vty_out(vty, "Total IGMP groups: %u\n", pim->gm_group_count);
vty_out(vty, "Watermark warn limit(%s): %u\n",
pim->igmp_watermark_limit ? "Set" : "Not Set",
pim->igmp_watermark_limit);
pim->gm_watermark_limit ? "Set" : "Not Set",
pim->gm_watermark_limit);
vty_out(vty,
"Interface Group Mode Timer Srcs V Uptime \n");
}
Expand Down Expand Up @@ -7165,7 +7165,7 @@ DEFPY (igmp_group_watermark,
"Group count to generate watermark warning\n")
{
PIM_DECLVAR_CONTEXT(vrf, pim);
pim->igmp_watermark_limit = limit;
pim->gm_watermark_limit = limit;

return CMD_SUCCESS;
}
Expand All @@ -7180,7 +7180,7 @@ DEFPY (no_igmp_group_watermark,
IGNORED_IN_NO_STR)
{
PIM_DECLVAR_CONTEXT(vrf, pim);
pim->igmp_watermark_limit = 0;
pim->gm_watermark_limit = 0;

return CMD_SUCCESS;
}
Expand Down
11 changes: 5 additions & 6 deletions pimd/pim_igmp.c
Original file line number Diff line number Diff line change
Expand Up @@ -799,25 +799,24 @@ static void igmp_group_free(struct gm_group *group)

static void igmp_group_count_incr(struct pim_interface *pim_ifp)
{
++pim_ifp->pim->igmp_group_count;
if (pim_ifp->pim->igmp_group_count
== pim_ifp->pim->igmp_watermark_limit) {
++pim_ifp->pim->gm_group_count;
if (pim_ifp->pim->gm_group_count == pim_ifp->pim->gm_watermark_limit) {
zlog_warn(
"IGMP group count reached watermark limit: %u(vrf: %s)",
pim_ifp->pim->igmp_group_count,
pim_ifp->pim->gm_group_count,
VRF_LOGNAME(pim_ifp->pim->vrf));
}
}

static void igmp_group_count_decr(struct pim_interface *pim_ifp)
{
if (pim_ifp->pim->igmp_group_count == 0) {
if (pim_ifp->pim->gm_group_count == 0) {
zlog_warn("Cannot decrement igmp group count below 0(vrf: %s)",
VRF_LOGNAME(pim_ifp->pim->vrf));
return;
}

--pim_ifp->pim->igmp_group_count;
--pim_ifp->pim->gm_group_count;
}

void igmp_group_delete(struct gm_group *group)
Expand Down
5 changes: 3 additions & 2 deletions pimd/pim_instance.h
Original file line number Diff line number Diff line change
Expand Up @@ -178,8 +178,9 @@ struct pim_instance {
struct list *ssmpingd_list;
struct in_addr ssmpingd_group_addr;

unsigned int igmp_group_count;
unsigned int igmp_watermark_limit;
/*IGMP or MLD Group count*/
unsigned int gm_group_count;
unsigned int gm_watermark_limit;
unsigned int keep_alive_time;
unsigned int rp_keep_alive_time;

Expand Down
4 changes: 2 additions & 2 deletions pimd/pim_vty.c
Original file line number Diff line number Diff line change
Expand Up @@ -244,9 +244,9 @@ int pim_global_config_write_worker(struct pim_instance *pim, struct vty *vty)
++writes;
}

if (pim->igmp_watermark_limit != 0) {
if (pim->gm_watermark_limit != 0) {
vty_out(vty, "%sip igmp watermark-warn %u\n", spaces,
pim->igmp_watermark_limit);
pim->gm_watermark_limit);
++writes;
}

Expand Down

0 comments on commit 9c8c6ad

Please sign in to comment.