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_zebra.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'ospfd/ospf_zebra.c') diff --git a/ospfd/ospf_zebra.c b/ospfd/ospf_zebra.c index 8f624a4d..52b23fe8 100644 --- a/ospfd/ospf_zebra.c +++ b/ospfd/ospf_zebra.c @@ -378,8 +378,8 @@ ospf_zebra_add (struct prefix_ipv4 *p, struct ospf_route *or) else { stream_putc (s, ZEBRA_NEXTHOP_IFINDEX); - if (path->oi) - stream_putl (s, path->oi->ifp->ifindex); + if (path->ifindex) + stream_putl (s, path->ifindex); else stream_putl (s, 0); } @@ -439,11 +439,11 @@ ospf_zebra_delete (struct prefix_ipv4 *p, struct ospf_route *or) nexthop = &path->nexthop; api.nexthop = &nexthop; } - else if (ospf_if_exists(path->oi) && (path->oi->ifp)) + else if (if_lookup_by_index(path->ifindex)) { SET_FLAG (api.message, ZAPI_MESSAGE_NEXTHOP); api.ifindex_num = 1; - api.ifindex = &path->oi->ifp->ifindex; + api.ifindex = &path->ifindex; } else if ( IS_DEBUG_OSPF(zebra,ZEBRA_REDISTRIBUTE) ) { -- cgit v1.2.1