summaryrefslogtreecommitdiff
path: root/ospfd/ospf_route.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_route.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_route.c')
-rw-r--r--ospfd/ospf_route.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/ospfd/ospf_route.c b/ospfd/ospf_route.c
index 0829e8ea..267237b8 100644
--- a/ospfd/ospf_route.c
+++ b/ospfd/ospf_route.c
@@ -165,7 +165,7 @@ ospf_route_match_same (struct route_table *rt, struct prefix_ipv4 *prefix,
if (! IPV4_ADDR_SAME (&op->nexthop, &newop->nexthop))
return 0;
- if (op->oi->ifp->ifindex != newop->oi->ifp->ifindex)
+ if (op->ifindex != newop->ifindex)
return 0;
}
return 1;
@@ -640,7 +640,7 @@ ospf_intra_add_stub (struct route_table *rt, struct router_lsa_link *link,
path = ospf_path_new ();
path->nexthop.s_addr = 0;
- path->oi = oi;
+ path->ifindex = oi->ifp->ifindex;
listnode_add (or->paths, path);
}
else
@@ -788,7 +788,8 @@ ospf_path_exist (struct list *plist, struct in_addr nexthop,
struct ospf_path *path;
for (ALL_LIST_ELEMENTS (plist, node, nnode, path))
- if (IPV4_ADDR_SAME (&path->nexthop, &nexthop) && path->oi == oi)
+ if (IPV4_ADDR_SAME (&path->nexthop, &nexthop) &&
+ path->ifindex == oi->ifp->ifindex)
return 1;
return 0;
@@ -815,7 +816,7 @@ ospf_route_copy_nexthops_from_vertex (struct ospf_route *to,
{
path = ospf_path_new ();
path->nexthop = nexthop->router;
- path->oi = nexthop->oi;
+ path->ifindex = nexthop->oi->ifp->ifindex;
listnode_add (to->paths, path);
}
}
@@ -834,7 +835,7 @@ ospf_path_lookup (struct list *plist, struct ospf_path *path)
continue;
if (!IPV4_ADDR_SAME (&op->adv_router, &path->adv_router))
continue;
- if (op->oi->ifp->ifindex != path->oi->ifp->ifindex)
+ if (op->ifindex != path->ifindex)
continue;
return op;
}