diff options
author | Russ White <russ@riw.us> | 2022-10-13 17:02:17 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-10-13 17:02:17 +0200 |
commit | fd30c2467a9a3afc615923af64f5de91937d268f (patch) | |
tree | 76cbbf8aa1e10ebe66fb42caa8495e4bcd7ecc39 /ospfd | |
parent | Merge pull request #11980 from isabelladeleon12/set_overload_startup (diff) | |
parent | ospfd: Allow unnumbered and numbered addresses to co-exist better (diff) | |
download | frr-fd30c2467a9a3afc615923af64f5de91937d268f.tar.xz frr-fd30c2467a9a3afc615923af64f5de91937d268f.zip |
Merge pull request #12115 from donaldsharp/ospf_unnumbered_showdown
ospfd: Allow unnumbered and numbered addresses to co-exist better
Diffstat (limited to 'ospfd')
-rw-r--r-- | ospfd/ospf_interface.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/ospfd/ospf_interface.c b/ospfd/ospf_interface.c index 646d31836..a0b14e73e 100644 --- a/ospfd/ospf_interface.c +++ b/ospfd/ospf_interface.c @@ -461,13 +461,13 @@ struct ospf_interface *ospf_if_lookup_recv_if(struct ospf *ospf, { struct route_node *rn; struct prefix_ipv4 addr; - struct ospf_interface *oi, *match; + struct ospf_interface *oi, *match, *unnumbered_match; addr.family = AF_INET; addr.prefix = src; addr.prefixlen = IPV4_MAX_BITLEN; - match = NULL; + match = unnumbered_match = NULL; for (rn = route_top(IF_OIFS(ifp)); rn; rn = route_next(rn)) { oi = rn->info; @@ -482,7 +482,7 @@ struct ospf_interface *ospf_if_lookup_recv_if(struct ospf *ospf, continue; if (CHECK_FLAG(oi->connected->flags, ZEBRA_IFA_UNNUMBERED)) - match = oi; + unnumbered_match = oi; else if (prefix_match(CONNECTED_PREFIX(oi->connected), (struct prefix *)&addr)) { if ((match == NULL) || (match->address->prefixlen @@ -491,7 +491,10 @@ struct ospf_interface *ospf_if_lookup_recv_if(struct ospf *ospf, } } - return match; + if (match) + return match; + + return unnumbered_match; } void ospf_interface_fifo_flush(struct ospf_interface *oi) |