From a8ba847ff96b41e06770d4987b15707890ed5807 Mon Sep 17 00:00:00 2001 From: Joakim Tjernlund Date: Mon, 27 Jul 2009 12:42:34 +0200 Subject: 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. --- ospfd/ospf_abr.c | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) (limited to 'ospfd/ospf_abr.c') diff --git a/ospfd/ospf_abr.c b/ospfd/ospf_abr.c index 88636f1a..7e32195b 100644 --- a/ospfd/ospf_abr.c +++ b/ospfd/ospf_abr.c @@ -814,15 +814,12 @@ ospf_abr_nexthops_belong_to_area (struct ospf_route *or, { struct listnode *node, *nnode; struct ospf_path *path; + struct ospf_interface *oi; - for (ALL_LIST_ELEMENTS (or->paths, node, nnode, path)) - { - struct ospf_interface *oi = path->oi; - - if (oi != NULL) - if (oi->area == area) - return 1; - } + for (ALL_LIST_ELEMENTS_RO (or->paths, node, path)) + for (ALL_LIST_ELEMENTS_RO (area->oiflist, nnode, oi)) + if (oi->ifp && oi->ifp->ifindex == path->ifindex) + return 1; return 0; } -- cgit v1.2.3