summaryrefslogtreecommitdiff
path: root/proto/ospf/ospf.h
diff options
context:
space:
mode:
authorOndrej Zajicek (work) <santiago@crfreenet.org>2021-05-10 13:39:55 +0200
committerOndrej Zajicek (work) <santiago@crfreenet.org>2021-05-10 13:39:55 +0200
commit2a0af925b83f699d126cf0e733a49c75ffd86033 (patch)
treedfd17aaf95a4684c2eba093bb62ecd4a00c011a0 /proto/ospf/ospf.h
parentbc591061f618cdc35cf21c7973a660f8d7018b43 (diff)
OSPF: Allow ifaces with host address as unnumbered PtP or PtMP ifaces
Ifaces with host address (/32) were forced to be stubby, but now they can be used as PtP or PtMP. For these ifaces we need to: - Do not force stub mode - Accept packets from any IP as local - Accept any configured neighbor as local - Detect ifaces properly as unnumbered - Use ONLINK flag for nexthops
Diffstat (limited to 'proto/ospf/ospf.h')
-rw-r--r--proto/ospf/ospf.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/proto/ospf/ospf.h b/proto/ospf/ospf.h
index fd2347e5..3e704ae8 100644
--- a/proto/ospf/ospf.h
+++ b/proto/ospf/ospf.h
@@ -946,6 +946,14 @@ struct lsadb_show_data {
#define EA_OSPF_ROUTER_ID EA_CODE(PROTOCOL_OSPF, 3)
+/*
+ * For regular networks, neighbor address must match network prefix.
+ * For unnumbered networks, we consider every address local.
+ */
+static inline int ospf_ipa_local(ip_addr a, const struct ifa *addr)
+{ return ipa_in_netX(a, &addr->prefix) || (addr->flags & IA_HOST); }
+
+
/* ospf.c */
void ospf_schedule_rtcalc(struct ospf_proto *p);