From 8cb40c91cdfb00ddf04e88d3ecd40403890d90f7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timo=20Ter=C3=A4s?= Date: Wed, 30 Mar 2016 13:44:03 +0300 Subject: cumulus take-3 --- ospfd/ospf_interface.c | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) (limited to 'ospfd/ospf_interface.c') diff --git a/ospfd/ospf_interface.c b/ospfd/ospf_interface.c index f4242b0b..fd3e239f 100644 --- a/ospfd/ospf_interface.c +++ b/ospfd/ospf_interface.c @@ -347,7 +347,12 @@ ospf_if_is_configured (struct ospf *ospf, struct in_addr *address) for (ALL_LIST_ELEMENTS (ospf->oiflist, node, nnode, oi)) if (oi->type != OSPF_IFTYPE_VIRTUALLINK) { - if (oi->type == OSPF_IFTYPE_POINTOPOINT) + if (CHECK_FLAG(oi->connected->flags, ZEBRA_IFA_UNNUMBERED)) + { + if (htonl(oi->ifp->ifindex) == address->s_addr) + return oi; + } + else if (oi->type == OSPF_IFTYPE_POINTOPOINT) { /* special leniency: match if addr is anywhere on peer subnet */ if (prefix_match(CONNECTED_PREFIX(oi->connected), @@ -471,8 +476,10 @@ ospf_if_lookup_recv_if (struct ospf *ospf, struct in_addr src, if (if_is_loopback (oi->ifp)) continue; - if (prefix_match (CONNECTED_PREFIX(oi->connected), - (struct prefix *) &addr)) + if (CHECK_FLAG(oi->connected->flags, ZEBRA_IFA_UNNUMBERED)) + match = oi; + else if (prefix_match (CONNECTED_PREFIX(oi->connected), + (struct prefix *) &addr)) { if ( (match == NULL) || (match->address->prefixlen < oi->address->prefixlen) @@ -866,6 +873,11 @@ ospf_vl_new (struct ospf *ospf, struct ospf_vl_data *vl_data) snprintf (ifname, sizeof(ifname), "VLINK%d", vlink_count); vi = if_create (ifname, strnlen(ifname, sizeof(ifname))); + /* + * if_create sets ZEBRA_INTERFACE_LINKDETECTION + * virtual links don't need this. + */ + UNSET_FLAG (vi->status, ZEBRA_INTERFACE_LINKDETECTION); co = connected_new (); co->ifp = vi; listnode_add (vi->connected, co); -- cgit v1.2.3