summaryrefslogtreecommitdiff
path: root/proto/ospf/rt.c
diff options
context:
space:
mode:
authorOndrej Zajicek <santiago@crfreenet.org>2024-04-04 18:37:26 +0200
committerOndrej Zajicek <santiago@crfreenet.org>2024-04-04 18:37:26 +0200
commit280daed57d061eb1ebc89013637c683fe23465e8 (patch)
tree91b4a338b2d3a986ee2ceddb48558c98a0cfc679 /proto/ospf/rt.c
parentbc10975adbb0aef772496f334dd0bbd23251c1d8 (diff)
OSPF: Allow loopback nexthop in OSPFv3-IPv4
In OSPFv3-IPv4 there is no requirement that link-local next hop announced in Link-LSA must be in interface address range. Therefore, for interfaces that do not have IPv4 address we can use some loopback IP address and announce it as a next hop. Also we should accept such address.
Diffstat (limited to 'proto/ospf/rt.c')
-rw-r--r--proto/ospf/rt.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/proto/ospf/rt.c b/proto/ospf/rt.c
index 471bb586..d7753ce0 100644
--- a/proto/ospf/rt.c
+++ b/proto/ospf/rt.c
@@ -2038,6 +2038,14 @@ again1:
{
neighbor *nbr = neigh_find(&p->p, nh->gw, nh->iface,
(nh->flags & RNF_ONLINK) ? NEF_ONLINK : 0);
+
+ /* According to RFC 5838 2.5 Direct Interface Address */
+ if (ospf_is_v3(p) && !nbr && ipa_is_ip4(nh->gw))
+ {
+ nh->flags |= RNF_ONLINK;
+ nbr = neigh_find(&p->p, nh->gw, nh->iface, NEF_ONLINK);
+ }
+
if (!nbr || (nbr->scope == SCOPE_HOST))
{ reset_ri(nf); break; }
}