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))
#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
#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
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;
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;
} /* 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) {
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;
return NB_OK;
}
-#endif /* PIM_IPV == 4 */
/*
* CLI reconfiguration affects the interface level (struct pim_interface).
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;
/* 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;
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;
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;
}
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)