]> git.puffer.fish Git - mirror/frr.git/commitdiff
pimd: Fixup to use new lastused
authorDonald Sharp <sharpd@cumulusnetworks.com>
Fri, 23 Sep 2016 19:43:19 +0000 (19:43 +0000)
committerDonald Sharp <sharpd@cumulusnetworks.com>
Thu, 22 Dec 2016 01:26:10 +0000 (20:26 -0500)
The kernel now reports lastused as the time in hz since
we last saw any packets.  So let's start tracking it
that way.

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

index bc351d8f7b3fefb120a5ef8b0284f89a1986067a..a35c9898ce7983a6aa7832d3eb3a3dd19d9490eb 100644 (file)
@@ -743,7 +743,6 @@ pim_mroute_update_counters (struct channel_oil *c_oil)
   c_oil->cc.oldpktcnt = c_oil->cc.pktcnt;
   c_oil->cc.oldbytecnt = c_oil->cc.bytecnt;
   c_oil->cc.oldwrong_if = c_oil->cc.wrong_if;
-  c_oil->cc.oldlastused = c_oil->cc.lastused;
 
   pim_zlookup_sg_statistics (c_oil);
   if (ioctl (qpim_mroute_socket_fd, SIOCGETSGCNT, &sgreq))
index 1bbd232e4d75a98f0163cde3334ffe363e334d36..4b23b211a9c4a6097fd9013a5a351542bbdf5569 100644 (file)
@@ -53,7 +53,6 @@
 struct channel_counts
 {
   unsigned long long lastused;
-  unsigned long long oldlastused;
   unsigned long pktcnt;
   unsigned long oldpktcnt;
   unsigned long bytecnt;
index 138843405bd3ab87fffc819390842db44c151bd7..64fffa38591224f0e19ff3f5c2f6a7a7d8957814 100644 (file)
@@ -882,7 +882,7 @@ pim_upstream_keep_alive_timer (struct thread *t)
   pim_mroute_update_counters (up->channel_oil);
 
   if ((up->channel_oil->cc.oldpktcnt >= up->channel_oil->cc.pktcnt) &&
-      (up->channel_oil->cc.oldlastused >= up->channel_oil->cc.lastused))
+      (up->channel_oil->cc.lastused/100 >= qpim_keep_alive_time))
     {
       pim_mroute_del (up->channel_oil);
       THREAD_OFF (up->t_ka_timer);