]> git.proxmox.com Git - mirror_frr.git/commitdiff
pim6d: Completing "ipv6 mld" command.
authorAbhishek N R <abnr@vmware.com>
Tue, 28 Jun 2022 10:53:04 +0000 (03:53 -0700)
committerAbhishek N R <abnr@vmware.com>
Thu, 7 Jul 2022 11:36:33 +0000 (04:36 -0700)
Signed-off-by: Abhishek N R <abnr@vmware.com>
pimd/pim6_mld.c
pimd/pim_addr.h
pimd/pim_iface.c
pimd/pim_nb_config.c
pimd/pim_vty.c

index 255fd62ba7b17c923bc12a2334af7d43e70f44f3..b661b68948e7d5113e935a9e13b345c344e9104e 100644 (file)
@@ -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))
index cb868bc7e13afa14e135493d6b621a7b9e03b73a..e28f121136c3fc7de3f74ba09481e96142ee4c94 100644 (file)
@@ -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
 
index ebe33f6c1643699a52e9e10992934431037ec4d8..738a548c7c5ee05dc17bdcdad1dc8ea111a10a22 100644 (file)
@@ -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) {
index 4fff1b31dbc8e530f81c18fa01fc05cf62ad9659..c40ffaff4eb69aadbbde19d95d22089f5bd6ac26 100644 (file)
@@ -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;
 }
 
index ef718467f01b5253beea7d9bfccd0b473b76fb24..76b230bbf1eb1ec037e88fcceb80d6c8845da641 100644 (file)
@@ -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)