]> git.proxmox.com Git - mirror_frr.git/commitdiff
pim6d: Completing "ipv6 mld query-max-response-time" command.
authorAbhishek N R <abnr@vmware.com>
Mon, 11 Jul 2022 08:33:07 +0000 (01:33 -0700)
committerAbhishek N R <abnr@vmware.com>
Mon, 29 Aug 2022 06:33:07 +0000 (23:33 -0700)
Signed-off-by: Abhishek N R <abnr@vmware.com>
pimd/pim6_mld.c
pimd/pim_nb_config.c
pimd/pim_vty.c

index badc25b47340fd4e6ebe03fd29266dccbf597f71..2bffede800736cb6f9efbfd4f735a8e014aefaed 100644 (file)
@@ -2091,11 +2091,10 @@ static void gm_start(struct interface *ifp)
        else
                gm_ifp->cur_version = GM_MLDV2;
 
-       /* hardcoded for dev without CLI */
-       gm_ifp->cur_qrv = 2;
+       gm_ifp->cur_qrv = pim_ifp->gm_default_robustness_variable;
        gm_ifp->cur_query_intv = pim_ifp->gm_default_query_interval * 1000;
        gm_ifp->cur_query_intv_trig = gm_ifp->cur_query_intv;
-       gm_ifp->cur_max_resp = 250;
+       gm_ifp->cur_max_resp = pim_ifp->gm_query_max_response_time_dsec * 100;
 
        gm_ifp->cfg_timing_fuzz.tv_sec = 0;
        gm_ifp->cfg_timing_fuzz.tv_usec = 10 * 1000;
@@ -2272,6 +2271,12 @@ void gm_ifp_update(struct interface *ifp)
                changed = true;
        }
 
+       unsigned int cfg_max_response =
+               pim_ifp->gm_query_max_response_time_dsec * 100;
+
+       if (gm_ifp->cur_max_resp != cfg_max_response)
+               gm_ifp->cur_max_resp = cfg_max_response;
+
        enum gm_version cfg_version;
 
        if (pim_ifp->mld_version == 1)
index 72b16a5f49e1a5a34735b40d41e07521818f04e5..87c8659fc5cb3babae8d699ae2a73098613e0a00 100644 (file)
@@ -454,14 +454,17 @@ static void change_query_interval(struct pim_interface *pim_ifp,
 }
 #endif
 
-#if PIM_IPV == 4
-static void change_query_max_response_time(struct pim_interface *pim_ifp,
-               int query_max_response_time_dsec)
+static void change_query_max_response_time(struct interface *ifp,
+                                          int query_max_response_time_dsec)
 {
+#if PIM_IPV == 4
        struct listnode *sock_node;
        struct gm_sock *igmp;
        struct listnode *grp_node;
        struct gm_group *grp;
+#endif
+
+       struct pim_interface *pim_ifp = ifp->info;
 
        if (pim_ifp->gm_query_max_response_time_dsec ==
            query_max_response_time_dsec)
@@ -469,6 +472,9 @@ static void change_query_max_response_time(struct pim_interface *pim_ifp,
 
        pim_ifp->gm_query_max_response_time_dsec = query_max_response_time_dsec;
 
+#if PIM_IPV == 6
+       gm_ifp_update(ifp);
+#else
        /*
         * Below we modify socket/group/source timers in order to quickly
         * reflect the change. Otherwise, those timers would args->eventually
@@ -501,8 +507,8 @@ static void change_query_max_response_time(struct pim_interface *pim_ifp,
                                igmp_source_reset_gmi(grp, src);
                }
        }
+#endif /* PIM_IPV == 4 */
 }
-#endif
 
 int routing_control_plane_protocols_name_validate(
        struct nb_cb_create_args *args)
@@ -2797,7 +2803,6 @@ int lib_interface_gmp_address_family_query_interval_modify(
 int lib_interface_gmp_address_family_query_max_response_time_modify(
        struct nb_cb_modify_args *args)
 {
-#if PIM_IPV == 4
        struct interface *ifp;
        int query_max_response_time_dsec;
 
@@ -2810,13 +2815,9 @@ int lib_interface_gmp_address_family_query_max_response_time_modify(
                ifp = nb_running_get_entry(args->dnode, NULL, true);
                query_max_response_time_dsec =
                        yang_dnode_get_uint16(args->dnode, NULL);
-               change_query_max_response_time(ifp->info,
-                               query_max_response_time_dsec);
+               change_query_max_response_time(ifp,
+                                              query_max_response_time_dsec);
        }
-#else
-       /* TBD Depends on MLD data structure changes */
-#endif
-
 
        return NB_OK;
 }
index cfbd436981f200dd6fc3b54ac986af7478d11429..80faa503f30d399106166c377970ecbdf16597c3 100644 (file)
@@ -378,6 +378,13 @@ static int gm_config_write(struct vty *vty, int writes,
 
        if (pim_ifp->mld_version != MLD_DEFAULT_VERSION)
                vty_out(vty, " ipv6 mld version %d\n", pim_ifp->mld_version);
+
+       /* IF ipv6 mld query-max-response-time */
+       if (pim_ifp->gm_query_max_response_time_dsec !=
+           IGMP_QUERY_MAX_RESPONSE_TIME_DSEC)
+               vty_out(vty, " ipv6 mld query-max-response-time %d\n",
+                       pim_ifp->gm_query_max_response_time_dsec);
+
        if (pim_ifp->gm_default_query_interval != IGMP_GENERAL_QUERY_INTERVAL)
                vty_out(vty, " ipv6 mld query-interval %d\n",
                        pim_ifp->gm_default_query_interval);