]> git.puffer.fish Git - mirror/frr.git/commitdiff
pimd: "show ip mroute" skips entries without an OIF
authorDaniel Walton <dwalton@cumulusnetworks.com>
Sat, 17 Sep 2016 04:10:44 +0000 (04:10 +0000)
committerDonald Sharp <sharpd@cumulusnetworks.com>
Thu, 22 Dec 2016 01:26:10 +0000 (20:26 -0500)
Signed-off-by: Daniel Walton <dwalton@cumulusnetworks.com>
The entry for 230.10.10.4 was not being displayed

root@superm-redxp-05[pimd]# ip mroute show
(20.0.13.253, 230.10.10.4)       Iif: br1
(20.0.13.253, 230.10.10.1)       Iif: br1        Oifs: swp1
root@superm-redxp-05[pimd]#

root@superm-redxp-05[pimd]#
root@superm-redxp-05[pimd]# vtysh -c 'show ip mroute'
Proto: I=IGMP P=PIM S=STATIC O=SOURCE

Source          Group           Proto Input iVifI Output oVifI TTL Uptime
20.0.13.253     230.10.10.1     P     br1       1 swp1       2   1 00:01:09
20.0.13.253     230.10.10.4     P     br1       1 none       0   0 --:--:--
root@superm-redxp-05[pimd]#

pimd/pim_cmd.c

index e6851089d669e60f038b15896d91528527c2d809..0c297271d0199a86c0eaea6cf8de5d578c9941f3 100644 (file)
@@ -2622,6 +2622,7 @@ static void show_mroute(struct vty *vty, u_char uj)
   json_object *json_source = NULL;
   json_object *json_ifp_in = NULL;
   json_object *json_ifp_out = NULL;
+  int found_oif = 0;
 
   if (uj) {
     json = json_object_new_object();
@@ -2642,6 +2643,7 @@ static void show_mroute(struct vty *vty, u_char uj)
     int oif_vif_index;
     char proto[5];
     struct interface *ifp_in;
+    found_oif = 0;
 
     if (!c_oil->installed)
       continue;
@@ -2693,6 +2695,7 @@ static void show_mroute(struct vty *vty, u_char uj)
 
       ifp_out = pim_if_find_by_vif_index(oif_vif_index);
       pim_time_uptime(oif_uptime, sizeof(oif_uptime), now - c_oil->oif_creation[oif_vif_index]);
+      found_oif = 1;
 
       if (ifp_out)
         strcpy(out_ifname, ifp_out->name);
@@ -2748,6 +2751,20 @@ static void show_mroute(struct vty *vty, u_char uj)
                 VTY_NEWLINE);
       }
     }
+
+    if (!uj && !found_oif) {
+      vty_out(vty, "%-15s %-15s %-5s %-5s %5d %-6s %5d %3d %8s %s",
+              src_str,
+              grp_str,
+              proto,
+              in_ifname,
+              c_oil->oil.mfcc_parent,
+              "none",
+              0,
+              0,
+              "--:--:--",
+              VTY_NEWLINE);
+    }
   }
 
   /* Print list of static routes */
@@ -2766,6 +2783,7 @@ static void show_mroute(struct vty *vty, u_char uj)
     pim_inet4_dump("<group?>", s_route->group, grp_str, sizeof(grp_str));
     pim_inet4_dump("<source?>", s_route->source, src_str, sizeof(src_str));
     ifp_in  = pim_if_find_by_vif_index(s_route->iif);
+    found_oif = 0;
 
     if (ifp_in)
       strcpy(in_ifname, ifp_in->name);
@@ -2814,6 +2832,7 @@ static void show_mroute(struct vty *vty, u_char uj)
 
       ifp_out = pim_if_find_by_vif_index(oif_vif_index);
       pim_time_uptime(oif_uptime, sizeof(oif_uptime), now - s_route->c_oil.oif_creation[oif_vif_index]);
+      found_oif = 1;
 
       if (ifp_out)
         strcpy(out_ifname, ifp_out->name);
@@ -2846,6 +2865,20 @@ static void show_mroute(struct vty *vty, u_char uj)
                 VTY_NEWLINE);
       }
     }
+
+    if (!uj && !found_oif) {
+        vty_out(vty, "%-15s %-15s %-5s %-5s %5d %-6s %5d %3d %8s %s",
+                src_str,
+                grp_str,
+                proto,
+                in_ifname,
+                c_oil->oil.mfcc_parent,
+                "none",
+                0,
+                0,
+                "--:--:--",
+                VTY_NEWLINE);
+    }
   }
 
   if (uj) {