summaryrefslogtreecommitdiff
path: root/nest/neighbor.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 /nest/neighbor.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 'nest/neighbor.c')
-rw-r--r--nest/neighbor.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/nest/neighbor.c b/nest/neighbor.c
index 2c2d3adf..63c07f83 100644
--- a/nest/neighbor.c
+++ b/nest/neighbor.c
@@ -217,7 +217,8 @@ neigh_find(struct proto *p, ip_addr a, struct iface *iface, uint flags)
struct ifa *addr = NULL;
WALK_LIST(n, neigh_hash_table[h]) /* Search the cache */
- if ((n->proto == p) && ipa_equal(n->addr, a) && (n->ifreq == iface))
+ if ((n->proto == p) && ipa_equal(n->addr, a) && (n->ifreq == iface) &&
+ ((n->flags & NEF_ONLINK) == (flags & NEF_ONLINK)))
return n;
if (flags & NEF_IFACE)