]> git.puffer.fish Git - mirror/frr.git/commitdiff
pimd: Allow (S,G) pimreg route to time out
authorDonald Sharp <sharpd@cumulusnetworks.com>
Wed, 13 Jul 2016 18:22:42 +0000 (14:22 -0400)
committerDonald Sharp <sharpd@cumulusnetworks.com>
Wed, 13 Jul 2016 18:22:42 +0000 (14:22 -0400)
When a kernel upcall happens for nocache we create
a (S,G) route to be installed into the kernel.
This code modification starts the ability to
time out the mroute if we stop receiving mcast
packets.

Ticket: CM-11793
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
pimd/pim_mroute.c
pimd/pim_upstream.c

index e1da3c61010bbf434c7280867759a0f5277242c0..ab3742438de9b7cf7b3233db9707e524ef9b8577 100644 (file)
@@ -156,6 +156,7 @@ pim_mroute_msg_nocache (int fd, struct interface *ifp, const struct igmpmsg *msg
     }
     return 0;
   }
+  up->channel_oil->cc.pktcnt++;
 
   pim_channel_add_oif(up->channel_oil, pim_regiface, PIM_OIF_FLAG_PROTO_SOURCE);
 
index cb2619abb73b8f9f92867b26cfa2c2f7f229b8d4..82678857565c2ab2af910be704f1f9de0c6e7274 100644 (file)
@@ -59,7 +59,7 @@ static void upstream_channel_oil_detach(struct pim_upstream *up)
 {
   if (up->channel_oil) {
     pim_channel_oil_del(up->channel_oil);
-    up->channel_oil = 0;
+    up->channel_oil = NULL;
   }
 }
 
@@ -715,12 +715,29 @@ pim_upstream_keep_alive_timer (struct thread *t)
 
   up = THREAD_ARG(t);
 
-  pim_br_clear_pmbr (up->source_addr, up->group_addr);
-  /*
-   * We need to do more here :)
-   * But this is the start.
-   */
+  if (I_am_RP (up->group_addr))
+    {
+      pim_br_clear_pmbr (up->source_addr, up->group_addr);
+      /*
+       * We need to do more here :)
+       * But this is the start.
+       */
+    }
+  else
+    {
+      pim_mroute_update_counters (up->channel_oil);
 
+      if (up->channel_oil->cc.oldpktcnt >= up->channel_oil->cc.pktcnt)
+       {
+         pim_mroute_del (up->channel_oil);
+         pim_upstream_delete (up);
+       }
+      else
+       {
+         up->t_ka_timer = NULL;
+         pim_upstream_keep_alive_timer_start (up, PIM_KEEPALIVE_PERIOD);
+       }
+    }
   return 1;
 }