summaryrefslogtreecommitdiff
path: root/ospfd/ospf_vty.c
diff options
context:
space:
mode:
authorJoakim Tjernlund <Joakim.Tjernlund@transmode.se>2009-07-27 12:42:34 +0200
committerPaul Jakma <paul@quagga.net>2009-08-03 16:52:30 +0100
commita8ba847ff96b41e06770d4987b15707890ed5807 (patch)
tree07864eb958853e5ad7b2616c9b7bc5259a8ae503 /ospfd/ospf_vty.c
parentbd5403778b0d96258730050e4526c7c72903e60b (diff)
ospfd: Change struct ospf_path *oi to ifindex.
* global: In struct ospf_path, change struct ospf_interface *oi to int ifindex. It is unsafe to reference *oi as an ospf interface can be deleted under your feet. Use a weak reference instead.
Diffstat (limited to 'ospfd/ospf_vty.c')
-rw-r--r--ospfd/ospf_vty.c23
1 files changed, 13 insertions, 10 deletions
diff --git a/ospfd/ospf_vty.c b/ospfd/ospf_vty.c
index 2e4b6078..7c3dec8c 100644
--- a/ospfd/ospf_vty.c
+++ b/ospfd/ospf_vty.c
@@ -7138,15 +7138,15 @@ show_ip_ospf_route_network (struct vty *vty, struct route_table *rt)
if (or->type == OSPF_DESTINATION_NETWORK)
for (ALL_LIST_ELEMENTS (or->paths, pnode, pnnode, path))
{
- if (path->oi != NULL && ospf_if_exists(path->oi))
+ if (if_lookup_by_index(path->ifindex))
{
if (path->nexthop.s_addr == 0)
vty_out (vty, "%24s directly attached to %s%s",
- "", path->oi->ifp->name, VTY_NEWLINE);
+ "", ifindex2ifname (path->ifindex), VTY_NEWLINE);
else
vty_out (vty, "%24s via %s, %s%s", "",
- inet_ntoa (path->nexthop), path->oi->ifp->name,
- VTY_NEWLINE);
+ inet_ntoa (path->nexthop),
+ ifindex2ifname (path->ifindex), VTY_NEWLINE);
}
}
}
@@ -7188,15 +7188,17 @@ show_ip_ospf_route_router (struct vty *vty, struct route_table *rtrs)
for (ALL_LIST_ELEMENTS_RO (or->paths, pnode, path))
{
- if (path->oi != NULL && ospf_if_exists(path->oi))
+ if (if_lookup_by_index(path->ifindex))
{
if (path->nexthop.s_addr == 0)
vty_out (vty, "%24s directly attached to %s%s",
- "", path->oi->ifp->name, VTY_NEWLINE);
+ "", ifindex2ifname (path->ifindex),
+ VTY_NEWLINE);
else
vty_out (vty, "%24s via %s, %s%s", "",
inet_ntoa (path->nexthop),
- path->oi->ifp->name, VTY_NEWLINE);
+ ifindex2ifname (path->ifindex),
+ VTY_NEWLINE);
}
}
}
@@ -7235,14 +7237,15 @@ show_ip_ospf_route_external (struct vty *vty, struct route_table *rt)
for (ALL_LIST_ELEMENTS (er->paths, pnode, pnnode, path))
{
- if (path->oi != NULL && ospf_if_exists(path->oi))
+ if (if_lookup_by_index(path->ifindex))
{
if (path->nexthop.s_addr == 0)
vty_out (vty, "%24s directly attached to %s%s",
- "", path->oi->ifp->name, VTY_NEWLINE);
+ "", ifindex2ifname (path->ifindex), VTY_NEWLINE);
else
vty_out (vty, "%24s via %s, %s%s", "",
- inet_ntoa (path->nexthop), path->oi->ifp->name,
+ inet_ntoa (path->nexthop),
+ ifindex2ifname (path->ifindex),
VTY_NEWLINE);
}
}