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.
diff --git a/ospfd/ospf_ase.c b/ospfd/ospf_ase.c
index 044f97c..7bddf3f 100644
--- a/ospfd/ospf_ase.c
+++ b/ospfd/ospf_ase.c
@@ -135,6 +135,7 @@
{
struct listnode *node;
struct ospf_path *op;
+ struct interface *ifp;
for (ALL_LIST_ELEMENTS_RO (ro->paths, node, op))
if (op->nexthop.s_addr == 0)
@@ -593,7 +594,7 @@
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;