Skip to content

Commit

Permalink
pim6d: Completing mld config commands. #11581
Browse files Browse the repository at this point in the history
  • Loading branch information
mobash-rasool committed Aug 29, 2022
1 parent c9f7e73 commit cc463a5
Show file tree
Hide file tree
Showing 4 changed files with 56 additions and 25 deletions.
29 changes: 23 additions & 6 deletions pimd/pim6_mld.c
Original file line number Diff line number Diff line change
Expand Up @@ -418,7 +418,7 @@ static void gm_sg_update(struct gm_sg *sg, bool has_expired)
gm_sg_timer_start(gm_ifp, sg, timers.expire_wait);

THREAD_OFF(sg->t_sg_query);
sg->n_query = gm_ifp->cur_qrv;
sg->n_query = gm_ifp->cur_lmqc;
sg->query_sbit = false;
gm_trigger_specific(sg);
}
Expand Down Expand Up @@ -2091,11 +2091,12 @@ 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_query_intv_trig =
pim_ifp->gm_specific_query_max_response_time_dsec * 100;
gm_ifp->cur_max_resp = pim_ifp->gm_query_max_response_time_dsec * 100;
gm_ifp->cur_lmqc = pim_ifp->gm_last_member_query_count;

gm_ifp->cfg_timing_fuzz.tv_sec = 0;
gm_ifp->cfg_timing_fuzz.tv_usec = 10 * 1000;
Expand Down Expand Up @@ -2268,10 +2269,26 @@ void gm_ifp_update(struct interface *ifp)

if (gm_ifp->cur_query_intv != cfg_query_intv) {
gm_ifp->cur_query_intv = cfg_query_intv;
gm_ifp->cur_query_intv_trig = cfg_query_intv;
changed = true;
}

unsigned int cfg_query_intv_trig =
pim_ifp->gm_specific_query_max_response_time_dsec * 100;

if (gm_ifp->cur_query_intv_trig != cfg_query_intv_trig) {
gm_ifp->cur_query_intv_trig = cfg_query_intv_trig;
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;

if (gm_ifp->cur_lmqc != pim_ifp->gm_last_member_query_count)
gm_ifp->cur_lmqc = pim_ifp->gm_last_member_query_count;

enum gm_version cfg_version;

if (pim_ifp->mld_version == 1)
Expand Down
1 change: 1 addition & 0 deletions pimd/pim6_mld.h
Original file line number Diff line number Diff line change
Expand Up @@ -324,6 +324,7 @@ struct gm_if {
unsigned int cur_query_intv_trig; /* ms */
unsigned int cur_max_resp; /* ms */
enum gm_version cur_version;
int cur_lmqc; /* last member query count in ds */

/* this value (positive, default 10ms) defines our "timing tolerance":
* - added to deadlines for expiring joins
Expand Down
31 changes: 12 additions & 19 deletions pimd/pim_nb_config.c
Original file line number Diff line number Diff line change
Expand Up @@ -454,21 +454,27 @@ 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)
return;

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
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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;

Expand All @@ -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;
}
Expand All @@ -2827,7 +2828,6 @@ int lib_interface_gmp_address_family_query_max_response_time_modify(
int lib_interface_gmp_address_family_last_member_query_interval_modify(
struct nb_cb_modify_args *args)
{
#if PIM_IPV == 4
struct interface *ifp;
struct pim_interface *pim_ifp;
int last_member_query_interval;
Expand All @@ -2847,9 +2847,6 @@ int lib_interface_gmp_address_family_last_member_query_interval_modify(

break;
}
#else
/* TBD Depends on MLD data structure changes */
#endif

return NB_OK;
}
Expand All @@ -2860,7 +2857,6 @@ int lib_interface_gmp_address_family_last_member_query_interval_modify(
int lib_interface_gmp_address_family_robustness_variable_modify(
struct nb_cb_modify_args *args)
{
#if PIM_IPV == 4
struct interface *ifp;
struct pim_interface *pim_ifp;
int last_member_query_count;
Expand All @@ -2879,9 +2875,6 @@ int lib_interface_gmp_address_family_robustness_variable_modify(

break;
}
#else
/* TBD Depends on MLD data structure changes */
#endif

return NB_OK;
}
Expand Down
20 changes: 20 additions & 0 deletions pimd/pim_vty.c
Original file line number Diff line number Diff line change
Expand Up @@ -378,9 +378,29 @@ 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);

/* IF ipv6 mld last-member_query-count */
if (pim_ifp->gm_last_member_query_count !=
IGMP_DEFAULT_ROBUSTNESS_VARIABLE)
vty_out(vty, " ipv6 mld last-member-query-count %d\n",
pim_ifp->gm_last_member_query_count);

/* IF ipv6 mld last-member_query-interval */
if (pim_ifp->gm_specific_query_max_response_time_dsec !=
IGMP_SPECIFIC_QUERY_MAX_RESPONSE_TIME_DSEC)
vty_out(vty, " ipv6 mld last-member-query-interval %d\n",
pim_ifp->gm_specific_query_max_response_time_dsec);

return 0;
}
#endif
Expand Down

0 comments on commit cc463a5

Please sign in to comment.