summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAbhishek N R <abnr@vmware.com>2022-06-28 12:53:04 +0200
committerAbhishek N R <abnr@vmware.com>2022-07-07 13:36:33 +0200
commit5c1b3cd2d9454ea8abee476c79c97cb2e139b77c (patch)
treef53547cf2ec59b21e5cd54d0cd6fdc10da784b79
parentMerge pull request #11454 from routingrocks/evpn_clag_frrlogs (diff)
downloadfrr-5c1b3cd2d9454ea8abee476c79c97cb2e139b77c.tar.xz
frr-5c1b3cd2d9454ea8abee476c79c97cb2e139b77c.zip
pim6d: Completing "ipv6 mld" command.
Signed-off-by: Abhishek N R <abnr@vmware.com>
-rw-r--r--pimd/pim6_mld.c10
-rw-r--r--pimd/pim_addr.h2
-rw-r--r--pimd/pim_iface.c8
-rw-r--r--pimd/pim_nb_config.c21
-rw-r--r--pimd/pim_vty.c6
5 files changed, 30 insertions, 17 deletions
diff --git a/pimd/pim6_mld.c b/pimd/pim6_mld.c
index 255fd62ba..b661b6894 100644
--- a/pimd/pim6_mld.c
+++ b/pimd/pim6_mld.c
@@ -2246,8 +2246,16 @@ void gm_ifp_update(struct interface *ifp)
return;
}
- if (!pim_ifp->mld)
+ /*
+ * If ipv6 mld is not enabled on interface, do not start mld activites.
+ */
+ if (!pim_ifp->gm_enable)
+ return;
+
+ if (!pim_ifp->mld) {
+ changed = true;
gm_start(ifp);
+ }
gm_ifp = pim_ifp->mld;
if (IPV6_ADDR_CMP(&pim_ifp->ll_lowest, &gm_ifp->cur_ll_lowest))
diff --git a/pimd/pim_addr.h b/pimd/pim_addr.h
index cb868bc7e..e28f12113 100644
--- a/pimd/pim_addr.h
+++ b/pimd/pim_addr.h
@@ -36,6 +36,7 @@ typedef struct in_addr pim_addr;
#define PIM_MAX_BITLEN IPV4_MAX_BITLEN
#define PIM_AF_NAME "ip"
#define PIMREG "pimreg"
+#define GM "IGMP"
#define PIM_ADDR_FUNCNAME(name) ipv4_##name
@@ -60,6 +61,7 @@ typedef struct in6_addr pim_addr;
#define PIM_MAX_BITLEN IPV6_MAX_BITLEN
#define PIM_AF_NAME "ipv6"
#define PIMREG "pim6reg"
+#define GM "MLD"
#define PIM_ADDR_FUNCNAME(name) ipv6_##name
diff --git a/pimd/pim_iface.c b/pimd/pim_iface.c
index ebe33f6c1..738a548c7 100644
--- a/pimd/pim_iface.c
+++ b/pimd/pim_iface.c
@@ -115,7 +115,7 @@ static int pim_sec_addr_comp(const void *p1, const void *p2)
return 0;
}
-struct pim_interface *pim_if_new(struct interface *ifp, bool igmp, bool pim,
+struct pim_interface *pim_if_new(struct interface *ifp, bool gm, bool pim,
bool ispimreg, bool is_vxlan_term)
{
struct pim_interface *pim_ifp;
@@ -154,9 +154,7 @@ struct pim_interface *pim_if_new(struct interface *ifp, bool igmp, bool pim,
pim_ifp->pim_enable = pim;
pim_ifp->pim_passive_enable = false;
-#if PIM_IPV == 4
- pim_ifp->gm_enable = igmp;
-#endif
+ pim_ifp->gm_enable = gm;
pim_ifp->gm_join_list = NULL;
pim_ifp->pim_neighbor_list = NULL;
@@ -821,7 +819,7 @@ void pim_if_addr_add_all(struct interface *ifp)
} /* pim */
}
/*
- * PIM or IGMP is enabled on interface, and there is at least one
+ * PIM or IGMP/MLD is enabled on interface, and there is at least one
* address assigned, then try to create a vif_index.
*/
if (pim_ifp->mroute_vif_index < 0) {
diff --git a/pimd/pim_nb_config.c b/pimd/pim_nb_config.c
index 4fff1b31d..c40ffaff4 100644
--- a/pimd/pim_nb_config.c
+++ b/pimd/pim_nb_config.c
@@ -348,8 +348,7 @@ static bool is_pim_interface(const struct lyd_node *dnode)
return false;
}
-#if PIM_IPV == 4
-static int pim_cmd_igmp_start(struct interface *ifp)
+static int pim_cmd_gm_start(struct interface *ifp)
{
struct pim_interface *pim_ifp;
uint8_t need_startup = 0;
@@ -377,7 +376,6 @@ static int pim_cmd_igmp_start(struct interface *ifp)
return NB_OK;
}
-#endif /* PIM_IPV == 4 */
/*
* CLI reconfiguration affects the interface level (struct pim_interface).
@@ -2584,7 +2582,6 @@ int lib_interface_gmp_address_family_destroy(struct nb_cb_destroy_args *args)
int lib_interface_gmp_address_family_enable_modify(
struct nb_cb_modify_args *args)
{
-#if PIM_IPV == 4
struct interface *ifp;
bool gm_enable;
struct pim_interface *pim_ifp;
@@ -2600,9 +2597,10 @@ int lib_interface_gmp_address_family_enable_modify(
/* Limiting mcast interfaces to number of VIFs */
if (mcast_if_count == MAXVIFS) {
ifp_name = yang_dnode_get_string(if_dnode, "name");
- snprintf(args->errmsg, args->errmsg_len,
- "Max multicast interfaces(%d) Reached. Could not enable IGMP on interface %s",
- MAXVIFS, ifp_name);
+ snprintf(
+ args->errmsg, args->errmsg_len,
+ "Max multicast interfaces(%d) Reached. Could not enable %s on interface %s",
+ MAXVIFS, GM, ifp_name);
return NB_ERR_VALIDATION;
}
break;
@@ -2614,7 +2612,7 @@ int lib_interface_gmp_address_family_enable_modify(
gm_enable = yang_dnode_get_bool(args->dnode, NULL);
if (gm_enable)
- return pim_cmd_igmp_start(ifp);
+ return pim_cmd_gm_start(ifp);
else {
pim_ifp = ifp->info;
@@ -2626,15 +2624,16 @@ int lib_interface_gmp_address_family_enable_modify(
pim_if_membership_clear(ifp);
+#if PIM_IPV == 4
pim_if_addr_del_all_igmp(ifp);
+#else
+ gm_ifp_teardown(ifp);
+#endif
if (!pim_ifp->pim_enable)
pim_if_delete(ifp);
}
}
-#else
- /* TBD Depends on MLD data structure changes */
-#endif /* PIM_IPV == 4 */
return NB_OK;
}
diff --git a/pimd/pim_vty.c b/pimd/pim_vty.c
index ef718467f..76b230bbf 100644
--- a/pimd/pim_vty.c
+++ b/pimd/pim_vty.c
@@ -365,6 +365,12 @@ static int gm_config_write(struct vty *vty, int writes,
static int gm_config_write(struct vty *vty, int writes,
struct pim_interface *pim_ifp)
{
+ /* IF ipv6 mld */
+ if (pim_ifp->gm_enable) {
+ vty_out(vty, " ipv6 mld\n");
+ ++writes;
+ }
+
if (pim_ifp->mld_version != MLD_DEFAULT_VERSION)
vty_out(vty, " ipv6 mld version %d\n", pim_ifp->mld_version);
if (pim_ifp->gm_default_query_interval != IGMP_GENERAL_QUERY_INTERVAL)