]> git.puffer.fish Git - mirror/frr.git/commitdiff
pimd: Get Static mroutes displaying again 224/head
authorDonald Sharp <sharpd@cumulusnetworks.com>
Fri, 24 Feb 2017 15:29:15 +0000 (10:29 -0500)
committerDonald Sharp <sharpd@cumulusnetworks.com>
Fri, 24 Feb 2017 15:31:34 +0000 (10:31 -0500)
The static mroutes were making the assumption that the vif index
and the ifindex were the same.  This is not necessarily the case.

Additionally if we are displaying a *,G route only display
the G.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
pimd/pim_static.c

index e1ccec387ace4d03891dfc4e5ebb933660884369..daaa95ab570dc1a3d4cbfa72f77b03e14df6d699 100644 (file)
@@ -316,27 +316,34 @@ int pim_static_del(struct interface *iif, struct interface *oif, struct in_addr
 int
 pim_static_write_mroute (struct vty *vty, struct interface *ifp)
 {
+  struct pim_interface *pim_ifp = ifp->info;
   struct listnode *node;
   struct static_route *sroute;
   int count = 0;
   char sbuf[INET_ADDRSTRLEN];
   char gbuf[INET_ADDRSTRLEN];
 
+  if (!pim_ifp)
+    return 0;
+
   for (ALL_LIST_ELEMENTS_RO (qpim_static_route_list, node, sroute))
     {
       pim_inet4_dump ("<ifaddr?>", sroute->group, gbuf, sizeof (gbuf));
       pim_inet4_dump ("<ifaddr?>", sroute->source, sbuf, sizeof (sbuf));
-      if (sroute->iif == ifp->ifindex)
-       {
-         int i;
-         for (i = 0; i < MAXVIFS; i++)
-           if (sroute->oif_ttls[i])
-             {
-               struct interface *oifp = if_lookup_by_index (i);
-               vty_out (vty, " ip mroute %s %s %s%s", oifp->name, gbuf, sbuf, VTY_NEWLINE);
-               count ++;
-             }
-       }
+      if (sroute->iif == pim_ifp->mroute_vif_index)
+        {
+          int i;
+          for (i = 0; i < MAXVIFS; i++)
+            if (sroute->oif_ttls[i])
+              {
+                struct interface *oifp = pim_if_find_by_vif_index (i);
+                if (sroute->source.s_addr == 0)
+                  vty_out (vty, " ip mroute %s %s%s", oifp->name, gbuf, VTY_NEWLINE);
+                else
+                  vty_out (vty, " ip mroute %s %s %s%s", oifp->name, gbuf, sbuf, VTY_NEWLINE);
+                count ++;
+              }
+        }
     }
 
   return count;