]> git.puffer.fish Git - matthieu/frr.git/commitdiff
pimd: Track if the mroute is installed or not
authorDonald Sharp <sharpd@cumulusnetwroks.com>
Tue, 12 Jul 2016 19:22:10 +0000 (15:22 -0400)
committerDonald Sharp <sharpd@cumulusnetwroks.com>
Tue, 12 Jul 2016 19:22:10 +0000 (15:22 -0400)
Track whether or not if a mroute has been installed
or not.  If not don't display information about it.

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

index 4e168bda0d0f5449cd98e8ac716cb85637d27e12..f27e3ff76d7246092872d80231e182f9be352c0d 100644 (file)
@@ -2190,6 +2190,9 @@ static void show_mroute(struct vty *vty)
     char source_str[100];
     int oif_vif_index;
 
+    if (!c_oil->installed)
+      continue;
+
     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));
     
@@ -2240,6 +2243,9 @@ static void show_mroute(struct vty *vty)
     char source_str[100];
     int oif_vif_index;
 
+    if (!s_route->c_oil.installed)
+      continue;
+
     pim_inet4_dump("<group?>", s_route->group, group_str, sizeof(group_str));
     pim_inet4_dump("<source?>", s_route->source, source_str, sizeof(source_str));
 
@@ -2305,6 +2311,9 @@ static void show_mroute_count(struct vty *vty)
     char source_str[100];
     struct sioc_sg_req sgreq;
 
+    if (!c_oil->installed)
+      continue;
+
     memset(&sgreq, 0, sizeof(sgreq));
     sgreq.src = c_oil->oil.mfcc_origin;
     sgreq.grp = c_oil->oil.mfcc_mcastgrp;
@@ -2340,6 +2349,9 @@ static void show_mroute_count(struct vty *vty)
     char source_str[100];
     struct sioc_sg_req sgreq;
 
+    if (!s_route->c_oil.installed)
+      continue;
+
     memset(&sgreq, 0, sizeof(sgreq));
     sgreq.src = s_route->c_oil.oil.mfcc_origin;
     sgreq.grp = s_route->c_oil.oil.mfcc_mcastgrp;
index 1b13d90869c7f9fa42360d5eec538bc9d7a157cf..4d9a9d0b7ededb7f6f34f55577b99bfffafa434d 100644 (file)
@@ -597,6 +597,7 @@ int pim_mroute_add(struct channel_oil *c_oil)
     return -2;
   }
 
+  c_oil->installed = 1;
   return 0;
 }
 
@@ -624,5 +625,7 @@ int pim_mroute_del (struct channel_oil *c_oil)
     return -2;
   }
 
+  c_oil->installed = 0;
+
   return 0;
 }
index 3d9b7d11fe4859f280ab71231a376064473c0b02..96f9ef2b62601c6185a174b0899c4670063beaca 100644 (file)
@@ -79,6 +79,7 @@ static struct channel_oil *channel_oil_new(struct in_addr group_addr,
   c_oil->oil.mfcc_origin   = source_addr;
   c_oil->oil.mfcc_parent   = input_vif_index;
   c_oil->oil_ref_count     = 1;
+  c_oil->installed         = 0;
 
   zassert(c_oil->oil_size == 0);
 
index f0a14a9baafd80a3c53326b369d6faf93e1fc7c3..143f2345f9375164dc286f6520265e7342bd37bf 100644 (file)
@@ -59,6 +59,7 @@
 
 struct channel_oil {
   struct mfcctl oil;
+  int           installed;
   int           oil_size;
   int           oil_ref_count;
   time_t        oif_creation[MAXVIFS];