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: Implement static IGMP joins without an IGMP report #16450

Merged
merged 3 commits into from
Aug 22, 2024
Merged
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
12 changes: 10 additions & 2 deletions doc/user/pim.rst
Original file line number Diff line number Diff line change
Expand Up @@ -251,9 +251,17 @@ is in a vrf, enter the interface command with the vrf keyword at the end.
Tell pim to receive IGMP reports and Query on this interface. The default
version is v3. This command is useful on a LHR.

.. clicmd:: ip igmp join A.B.C.D [A.B.C.D]
.. clicmd:: ip igmp join-group A.B.C.D [A.B.C.D]

Join multicast group or source-group on an interface.
Join multicast group or source-group on an interface. This will result in
an IGMP join happening through a local socket so that IGMP reports will be
sent on this interface. It may also have the side effect of the kernel
forwarding multicast traffic to the socket unnessarily.

.. clicmd:: ip igmp static-group A.B.C.D [A.B.C.D]

Add a static multicast group or source-group on an interface. This will behave
as if there is a receiver on this interface without any IGMP reports.

.. clicmd:: ip igmp query-interval (1-65535)

Expand Down
82 changes: 47 additions & 35 deletions pimd/pim6_cmd.c
Original file line number Diff line number Diff line change
Expand Up @@ -1363,45 +1363,56 @@ DEFPY_ATTR(no_ipv6_ssmpingd,
return ret;
}

DEFPY (interface_ipv6_mld_join,
interface_ipv6_mld_join_cmd,
"ipv6 mld join X:X::X:X$group [X:X::X:X$source]",
DEFPY_YANG_HIDDEN (interface_ipv6_mld_join,
interface_ipv6_mld_join_cmd,
"[no] ipv6 mld join X:X::X:X$grp [X:X::X:X]$src",
NO_STR
IPV6_STR
IFACE_MLD_STR
"MLD join multicast group\n"
"Multicast group address\n"
"Source address\n")
{
nb_cli_enqueue_change(vty, ".", (!no ? NB_OP_CREATE : NB_OP_DESTROY),
NULL);
return nb_cli_apply_changes(vty, FRR_GMP_JOIN_GROUP_XPATH,
"frr-routing:ipv6", grp_str,
(src_str ? src_str : "::"));
}
ALIAS (interface_ipv6_mld_join,
interface_ipv6_mld_join_group_cmd,
"[no] ipv6 mld join-group X:X::X:X$grp [X:X::X:X]$src",
NO_STR
IPV6_STR
IFACE_MLD_STR
"MLD join multicast group\n"
"Multicast group address\n"
"Source address\n")
{
char xpath[XPATH_MAXLEN];

if (!IN6_IS_ADDR_MULTICAST(&group)) {
vty_out(vty, "Invalid Multicast Address\n");
return CMD_WARNING_CONFIG_FAILED;
}

if (source_str) {
if (IPV6_ADDR_SAME(&source, &in6addr_any)) {
vty_out(vty, "Bad source address %s\n", source_str);
return CMD_WARNING_CONFIG_FAILED;
}
} else
source_str = "::";

snprintf(xpath, sizeof(xpath), FRR_GMP_JOIN_XPATH, "frr-routing:ipv6",
group_str, source_str);

nb_cli_enqueue_change(vty, xpath, NB_OP_CREATE, NULL);

return nb_cli_apply_changes(vty, NULL);
}

DEFPY (interface_no_ipv6_mld_join,
interface_no_ipv6_mld_join_cmd,
"no ipv6 mld join X:X::X:X$group [X:X::X:X$source]",
"Source address\n");

DEFPY_YANG (interface_ipv6_mld_static_group,
interface_ipv6_mld_static_group_cmd,
"[no] ipv6 mld static-group X:X::X:X$grp [X:X::X:X]$src",
NO_STR
IPV6_STR
IFACE_MLD_STR
"Static multicast group\n"
"Multicast group address\n"
"Source address\n")
{
nb_cli_enqueue_change(vty, ".", (!no ? NB_OP_CREATE : NB_OP_DESTROY),
NULL);
return nb_cli_apply_changes(vty, FRR_GMP_STATIC_GROUP_XPATH,
"frr-routing:ipv6", grp_str,
(src_str ? src_str : "::"));
}

DEFPY (interface_no_ipv6_mld_static_group,
interface_no_ipv6_mld_static_group_cmd,
"no ipv6 mld static-group X:X::X:X$group [X:X::X:X$source]",
NO_STR
IPV6_STR
IFACE_MLD_STR
"MLD join multicast group\n"
"Static multicast group\n"
"Multicast group address\n"
"Source address\n")
{
Expand All @@ -1415,8 +1426,8 @@ DEFPY (interface_no_ipv6_mld_join,
} else
source_str = "::";

snprintf(xpath, sizeof(xpath), FRR_GMP_JOIN_XPATH, "frr-routing:ipv6",
group_str, source_str);
snprintf(xpath, sizeof(xpath), FRR_GMP_STATIC_GROUP_XPATH,
"frr-routing:ipv6", group_str, source_str);

nb_cli_enqueue_change(vty, xpath, NB_OP_DESTROY, NULL);

Expand Down Expand Up @@ -2669,7 +2680,8 @@ void pim_cmd_init(void)
install_element(INTERFACE_NODE, &interface_ipv6_mld_cmd);
install_element(INTERFACE_NODE, &interface_no_ipv6_mld_cmd);
install_element(INTERFACE_NODE, &interface_ipv6_mld_join_cmd);
install_element(INTERFACE_NODE, &interface_no_ipv6_mld_join_cmd);
install_element(INTERFACE_NODE, &interface_ipv6_mld_join_group_cmd);
install_element(INTERFACE_NODE, &interface_ipv6_mld_static_group_cmd);
install_element(INTERFACE_NODE, &interface_ipv6_mld_version_cmd);
install_element(INTERFACE_NODE, &interface_no_ipv6_mld_version_cmd);
install_element(INTERFACE_NODE, &interface_ipv6_mld_query_interval_cmd);
Expand Down
Loading
Loading