]> git.puffer.fish Git - mirror/frr.git/commitdiff
pimd: Allow keep alive timer configuration
authorDonald Sharp <sharpd@cumulusnetworks.com>
Thu, 18 Aug 2016 13:07:14 +0000 (09:07 -0400)
committerDonald Sharp <sharpd@cumulusnetworks.com>
Thu, 22 Dec 2016 01:26:06 +0000 (20:26 -0500)
Allow the user to specify the time to wait
for a keep alive to happen.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
pimd/pim_cmd.c
pimd/pim_mroute.c
pimd/pim_register.c
pimd/pim_upstream.c
pimd/pim_vty.c
pimd/pimd.c
pimd/pimd.h

index d5f1255e17c9e40fb0c2d3cad01a6229827c92f1..78e0d4671571007c0f3f210f91f0fb3c79bdbd5c 100644 (file)
@@ -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); 
 
index f222e5f575c58d5b0a48cc3fee14ecbd4d5ff0ae..02d6e8a0996430b579efd800a20805e49b9ecdef 100644 (file)
@@ -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);
index 471279f077178c6383c8e48cbf9e47c36bed9a4a..129f38cbdc6f235e655f8dc290ad824666067f1e 100644 (file)
@@ -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);
       }
     }
 
index 8d908b719e4c6a41bbe4d783f0ce943271f61a14..10f8b21ed01729c18905f1804bcb8cbb7d9af638 100644 (file)
@@ -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;
index f279136651410b3a0b472a70af33018f609f9599..bc4acfdb06eb074b219ea37f2ca578bafc9a7f38 100644 (file)
@@ -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;
index 2e21349a4849a4635eca39b51501523a0fd19824..4323fad0ec1dcd9cfcff759db19378ebb7d5f614 100644 (file)
@@ -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;
index e9b67aaa99e7b539da6fa1d9c85161daa68b1105..1118fd2a6218c80e65e2bd91cdb6b5d59ee8843a 100644 (file)
@@ -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)