]> git.puffer.fish Git - mirror/frr.git/commitdiff
pimd: Don't ask for information when you are notgoing to get an answer
authorDonald Sharp <sharpd@cumulusnetworks.com>
Tue, 27 Sep 2016 03:13:42 +0000 (23:13 -0400)
committerDonald Sharp <sharpd@cumulusnetworks.com>
Thu, 22 Dec 2016 01:26:10 +0000 (20:26 -0500)
When we have intentionally not installed a mroute( for whatever
reason ), do not ask for information about that mroute from the
kernel when it happens.

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

index c53a0393c0b72a2e2be2f73898568f5f596174aa..9ef29b6e42a6f76e6d7fabb556db5e0469fd08d8 100644 (file)
@@ -737,29 +737,46 @@ pim_mroute_update_counters (struct channel_oil *c_oil)
 {
   struct sioc_sg_req sgreq;
 
-  memset (&sgreq, 0, sizeof(sgreq));
-  sgreq.src = c_oil->oil.mfcc_origin;
-  sgreq.grp = c_oil->oil.mfcc_mcastgrp;
-
   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;
 
+  if (!c_oil->installed)
+    {
+      c_oil->cc.lastused = 100 * qpim_keep_alive_time;
+      if (PIM_DEBUG_MROUTE)
+       {
+         struct prefix_sg sg;
+
+         sg.src = c_oil->oil.mfcc_origin;
+         sg.grp = c_oil->oil.mfcc_mcastgrp;
+         if (PIM_DEBUG_MROUTE)
+           zlog_debug("Channel(%s) is not installed no need to collect data from kernel",
+                      pim_str_sg_dump (&sg));
+       }
+      return;
+    }
+
+  memset (&sgreq, 0, sizeof(sgreq));
+  sgreq.src = c_oil->oil.mfcc_origin;
+  sgreq.grp = c_oil->oil.mfcc_mcastgrp;
+
   pim_zlookup_sg_statistics (c_oil);
   if (ioctl (qpim_mroute_socket_fd, SIOCGETSGCNT, &sgreq))
     {
-      char group_str[100];
-      char source_str[100];
-
-      pim_inet4_dump("<group?>", c_oil->oil.mfcc_mcastgrp, group_str, sizeof(group_str));
-      pim_inet4_dump("<source?>", c_oil->oil.mfcc_origin, source_str, sizeof(source_str));
-
-      zlog_warn ("ioctl(SIOCGETSGCNT=%lu) failure for (S,G)=(%s,%s): errno=%d: %s",
-                (unsigned long)SIOCGETSGCNT,
-                source_str,
-                group_str,
-                errno,
-                safe_strerror(errno));
+      if (PIM_DEBUG_MROUTE)
+       {
+         struct prefix_sg sg;
+
+         sg.src = c_oil->oil.mfcc_origin;
+         sg.grp = c_oil->oil.mfcc_mcastgrp;
+
+         zlog_warn ("ioctl(SIOCGETSGCNT=%lu) failure for (S,G)=(%s): errno=%d: %s",
+                    (unsigned long)SIOCGETSGCNT,
+                    pim_str_sg_dump (&sg),
+                    errno,
+                    safe_strerror(errno));
+       }
       return;
     }
 
index 8c8fb55ce23136fbe988cc9c3b4836d57754a2db..4e6c76f0b0d3c5dcc48e513ef40c625bb6472999 100644 (file)
@@ -448,7 +448,13 @@ pim_zlookup_sg_statistics (struct channel_oil *c_oil)
   struct interface *ifp = pim_if_find_by_vif_index (c_oil->oil.mfcc_parent);
 
   if (PIM_DEBUG_ZEBRA)
-    zlog_debug ("Sending Request for New Channel Oil Information");
+    {
+      struct prefix_sg more;
+
+      more.src = c_oil->oil.mfcc_origin;
+      more.grp = c_oil->oil.mfcc_mcastgrp;
+      zlog_debug ("Sending Request for New Channel Oil Information(%s)", pim_str_sg_dump (&more));
+    }
 
   stream_reset (s);
   zclient_create_header (s, ZEBRA_IPMR_ROUTE_STATS, VRF_DEFAULT);