From 98dda61bc222aeccb754915954175d3ac8f8768d Mon Sep 17 00:00:00 2001 From: Joakim Tjernlund Date: Thu, 13 Aug 2009 15:39:42 +0000 Subject: ospfd: Update SPF calculation for unnumbered links Add support for real unnumbered PtP interfaces in ospf_nexthop_calculation(). Add ospf_if_lookup_by_ifindex() to support Unnumbered PtP links. This version does not support: - Multiple numbered PtP interfaces with the same IP address between the same two routers. - Unnumbered PtP on just one end of the link. * ospfd/ospf_interface.c: Add ospf_if_lookup_by_ifindex(). * ospfd/ospf_interface.h: ditto. * ospfd/ospf_spf.c: ospf_nexthop_calculation (), call ospf_if_lookup_by_ifindex() for Unnumbered PtP links. --- ospfd/ospf_interface.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'ospfd/ospf_interface.c') diff --git a/ospfd/ospf_interface.c b/ospfd/ospf_interface.c index afe3acf1..775b121f 100644 --- a/ospfd/ospf_interface.c +++ b/ospfd/ospf_interface.c @@ -479,6 +479,20 @@ ospf_if_lookup_recv_if (struct ospf *ospf, struct in_addr src, return match; } + +struct ospf_interface * +ospf_if_lookup_by_ifindex(struct ospf_area *area, unsigned int ifindex) +{ + struct listnode *node; + struct ospf_interface *oi; + + for (ALL_LIST_ELEMENTS_RO (area->oiflist, node, oi)) + { + if (oi->ifp->ifindex == ifindex) + return oi; + } + return NULL; +} void ospf_if_stream_set (struct ospf_interface *oi) -- cgit v1.2.3