From: Donald Sharp Date: Thu, 18 Aug 2016 13:07:14 +0000 (-0400) Subject: pimd: Allow keep alive timer configuration X-Git-Tag: frr-3.0-branchpoint~64^2~10^2~284 X-Git-Url: https://git.puffer.fish/?a=commitdiff_plain;h=4304f95c86af2ea658678fb969b984108a4c597f;p=matthieu%2Ffrr.git pimd: Allow keep alive timer configuration Allow the user to specify the time to wait for a keep alive to happen. Signed-off-by: Donald Sharp --- diff --git a/pimd/pim_cmd.c b/pimd/pim_cmd.c index d5f1255e17..78e0d46715 100644 --- a/pimd/pim_cmd.c +++ b/pimd/pim_cmd.c @@ -2450,6 +2450,31 @@ pim_rp_cmd_worker (struct vty *vty, const char *rp, const char *group) return CMD_SUCCESS; } +DEFUN (ip_pim_keep_alive, + ip_pim_keep_alive_cmd, + "ip pim keep-alive-timer <31-600>", + IP_STR + "pim multicast routing\n" + "Keep alive Timer" + "Seconds") +{ + qpim_keep_alive_time = atoi (argv[3]->arg); + return CMD_SUCCESS; +} + +DEFUN (no_ip_pim_keep_alive, + no_ip_pim_keep_alive_cmd, + "no ip pim keep-alive-timer <31-600>", + NO_STR + IP_STR + "pim multicast routing\n" + "Keep alive Timer" + "Seconds") +{ + qpim_keep_alive_time = PIM_KEEPALIVE_PERIOD; + return CMD_SUCCESS; +} + DEFUN (ip_pim_rp, ip_pim_rp_cmd, "ip pim rp A.B.C.D [A.B.C.D/M]", @@ -4754,6 +4779,8 @@ void pim_cmd_init() install_element (CONFIG_NODE, &no_ip_multicast_routing_cmd); install_element (CONFIG_NODE, &ip_pim_rp_cmd); install_element (CONFIG_NODE, &no_ip_pim_rp_cmd); + install_element (CONFIG_NODE, &ip_pim_keep_alive_cmd); + install_element (CONFIG_NODE, &no_ip_pim_keep_alive_cmd); install_element (CONFIG_NODE, &ip_ssmpingd_cmd); install_element (CONFIG_NODE, &no_ip_ssmpingd_cmd); diff --git a/pimd/pim_mroute.c b/pimd/pim_mroute.c index f222e5f575..02d6e8a099 100644 --- a/pimd/pim_mroute.c +++ b/pimd/pim_mroute.c @@ -156,7 +156,7 @@ pim_mroute_msg_nocache (int fd, struct interface *ifp, const struct igmpmsg *msg return 0; } - pim_upstream_keep_alive_timer_start (up, PIM_KEEPALIVE_PERIOD); + pim_upstream_keep_alive_timer_start (up, qpim_keep_alive_time); up->channel_oil = pim_channel_oil_add(&sg, pim_ifp->mroute_vif_index); @@ -373,7 +373,7 @@ pim_mroute_msg_wrvifwhole (int fd, struct interface *ifp, const char *buf) up->fhr = 1; pim_ifp = ifp->info; - pim_upstream_keep_alive_timer_start (up, PIM_KEEPALIVE_PERIOD); + pim_upstream_keep_alive_timer_start (up, qpim_keep_alive_time); up->channel_oil = pim_channel_oil_add (&sg, pim_ifp->mroute_vif_index); up->channel_oil->cc.pktcnt++; pim_channel_add_oif (up->channel_oil, pim_regiface, PIM_OIF_FLAG_PROTO_PIM); diff --git a/pimd/pim_register.c b/pimd/pim_register.c index 471279f077..129f38cbdc 100644 --- a/pimd/pim_register.c +++ b/pimd/pim_register.c @@ -349,7 +349,7 @@ pim_register_recv (struct interface *ifp, if (sentRegisterStop) { pim_upstream_keep_alive_timer_start (upstream, PIM_RP_KEEPALIVE_PERIOD); } else { - pim_upstream_keep_alive_timer_start (upstream, PIM_KEEPALIVE_PERIOD); + pim_upstream_keep_alive_timer_start (upstream, qpim_keep_alive_time); } } diff --git a/pimd/pim_upstream.c b/pimd/pim_upstream.c index 8d908b719e..10f8b21ed0 100644 --- a/pimd/pim_upstream.c +++ b/pimd/pim_upstream.c @@ -842,7 +842,7 @@ pim_upstream_keep_alive_timer (struct thread *t) else { up->t_ka_timer = NULL; - pim_upstream_keep_alive_timer_start (up, PIM_KEEPALIVE_PERIOD); + pim_upstream_keep_alive_timer_start (up, qpim_keep_alive_time); } return 1; diff --git a/pimd/pim_vty.c b/pimd/pim_vty.c index f279136651..bc4acfdb06 100644 --- a/pimd/pim_vty.c +++ b/pimd/pim_vty.c @@ -138,6 +138,12 @@ int pim_global_config_write(struct vty *vty) writes += pim_rp_config_write (vty); + if (qpim_keep_alive_time != PIM_KEEPALIVE_PERIOD) + { + vty_out (vty, "ip pim keep-alive-timer %d%s", + qpim_keep_alive_time, VTY_NEWLINE); + ++writes; + } if (qpim_ssmpingd_list) { struct listnode *node; struct ssmpingd_sock *ss; diff --git a/pimd/pimd.c b/pimd/pimd.c index 2e21349a48..4323fad0ec 100644 --- a/pimd/pimd.c +++ b/pimd/pimd.c @@ -69,6 +69,7 @@ int64_t qpim_mroute_add_last = 0; int64_t qpim_mroute_del_events = 0; int64_t qpim_mroute_del_last = 0; struct list *qpim_static_route_list = NULL; +unsigned int qpim_keep_alive_time = PIM_KEEPALIVE_PERIOD; int32_t qpim_register_suppress_time = PIM_REGISTER_SUPPRESSION_TIME_DEFAULT; int32_t qpim_register_probe_time = PIM_REGISTER_PROBE_TIME_DEFAULT; diff --git a/pimd/pimd.h b/pimd/pimd.h index e9b67aaa99..1118fd2a62 100644 --- a/pimd/pimd.h +++ b/pimd/pimd.h @@ -104,6 +104,7 @@ int64_t qpim_mroute_add_last; int64_t qpim_mroute_del_events; int64_t qpim_mroute_del_last; struct list *qpim_static_route_list; /* list of routes added statically */ +extern unsigned int qpim_keep_alive_time; #define PIM_JP_HOLDTIME (qpim_t_periodic * 7 / 2)