summaryrefslogtreecommitdiff
path: root/pimd
diff options
context:
space:
mode:
authorRafael Zalamena <rzalamena@opensourcerouting.org>2024-09-19 22:56:38 -0300
committerRafael Zalamena <rzalamena@opensourcerouting.org>2025-02-10 15:40:07 -0300
commit99861a084a5e29285d2229e8ee09de789e0b12e1 (patch)
tree8094875586f4b3b80819659426c380d6f8d57492 /pimd
parent8a29d740044abe0a504b8739f2b449f3f4b877da (diff)
pim6d: implement clear IPv6 MLD interfaces
Allow user to reset MLD state on all interfaces in a VRF. Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
Diffstat (limited to 'pimd')
-rw-r--r--pimd/pim6_cmd.c27
1 files changed, 27 insertions, 0 deletions
diff --git a/pimd/pim6_cmd.c b/pimd/pim6_cmd.c
index 63444539ee..40bd7caf7d 100644
--- a/pimd/pim6_cmd.c
+++ b/pimd/pim6_cmd.c
@@ -2378,6 +2378,32 @@ DEFPY (show_ipv6_pim_bsrp,
return pim_show_group_rp_mappings_info_helper(vrf, vty, !!json);
}
+DEFPY(clear_ipv6_mld_interfaces,
+ clear_ipv6_mld_interfaces_cmd,
+ "clear ipv6 mld [vrf NAME$vrf_name] interfaces",
+ CLEAR_STR
+ IPV6_STR
+ "MLD clear commands\n"
+ VRF_CMD_HELP_STR
+ "Reset MLD interfaces\n")
+{
+ struct interface *ifp;
+ struct vrf *vrf;
+
+ vrf = vrf_name ? vrf_lookup_by_name(vrf_name) : vrf_lookup_by_id(VRF_DEFAULT);
+ if (!vrf) {
+ vty_out(vty, "Specified VRF: %s does not exist\n", vrf_name);
+ return CMD_WARNING;
+ }
+
+ FOR_ALL_INTERFACES (vrf, ifp)
+ pim_if_addr_del_all(ifp);
+ FOR_ALL_INTERFACES (vrf, ifp)
+ pim_if_addr_add_all(ifp);
+
+ return CMD_SUCCESS;
+}
+
DEFPY (clear_ipv6_pim_statistics,
clear_ipv6_pim_statistics_cmd,
"clear ipv6 pim statistics [vrf NAME]$name",
@@ -2975,6 +3001,7 @@ void pim_cmd_init(void)
install_element(VIEW_NODE, &show_ipv6_pim_bsr_cmd);
install_element(VIEW_NODE, &show_ipv6_pim_bsm_db_cmd);
install_element(VIEW_NODE, &show_ipv6_pim_bsrp_cmd);
+ install_element(ENABLE_NODE, &clear_ipv6_mld_interfaces_cmd);
install_element(ENABLE_NODE, &clear_ipv6_pim_statistics_cmd);
install_element(ENABLE_NODE, &clear_ipv6_mroute_cmd);
install_element(ENABLE_NODE, &clear_ipv6_pim_oil_cmd);