summaryrefslogtreecommitdiff
path: root/pimd/pim_static.c
diff options
context:
space:
mode:
authorDonald Sharp <sharpd@cumulusnetworks.com>2017-02-24 10:29:15 -0500
committerDonald Sharp <sharpd@cumulusnetworks.com>2017-02-24 10:31:34 -0500
commitce9531309c1298ad3da65a4f29b2f835e812131c (patch)
treee9c2eb6c6faad794254c07ac231a0416a6aa546a /pimd/pim_static.c
parent79bdcd99745ae16ee57b98bac5477f8bd6d20d4e (diff)
pimd: Get Static mroutes displaying again
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>
Diffstat (limited to 'pimd/pim_static.c')
-rw-r--r--pimd/pim_static.c29
1 files changed, 18 insertions, 11 deletions
diff --git a/pimd/pim_static.c b/pimd/pim_static.c
index e1ccec387a..daaa95ab57 100644
--- a/pimd/pim_static.c
+++ b/pimd/pim_static.c
@@ -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;