summaryrefslogtreecommitdiff
path: root/proto/ospf/ospf.h
diff options
context:
space:
mode:
authorOndrej Zajicek (work) <santiago@crfreenet.org>2021-05-09 15:16:13 +0200
committerOndrej Zajicek (work) <santiago@crfreenet.org>2021-05-09 15:26:13 +0200
commitbc591061f618cdc35cf21c7973a660f8d7018b43 (patch)
tree003c26b28e57193c14a7598e1ed757427b8b26b6 /proto/ospf/ospf.h
parent1647923bd8d2f8e53337365abc5be7e343aa570c (diff)
OSPF: Packets on PtP networks should be always sent to AllSPFRouters
As specified in RFC 2328 8.1: "On physical point-to-point networks, the IP destination is always set to the address AllSPFRouters." Note that this likely break setups with multiple neighbors on a network configured as PtP, which worked before. These should be configured as PtMP. Thanks to Senthil Kumar Nagappan for the original patch and to Joakim Tjernlund for suggestions.
Diffstat (limited to 'proto/ospf/ospf.h')
-rw-r--r--proto/ospf/ospf.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/proto/ospf/ospf.h b/proto/ospf/ospf.h
index aa7d937e..fd2347e5 100644
--- a/proto/ospf/ospf.h
+++ b/proto/ospf/ospf.h
@@ -1058,6 +1058,9 @@ void ospf_verr_hook(sock *sk, int err);
void ospf_send_to(struct ospf_iface *ifa, ip_addr ip);
void ospf_send_to_iface(struct ospf_iface *ifa);
+static inline void ospf_send_to_nbr(struct ospf_iface *ifa, struct ospf_neighbor *n)
+{ ospf_send_to(ifa, (ifa->type == OSPF_IT_PTP) ? ifa->all_routers : n->ip); }
+
static inline void ospf_send_to_all(struct ospf_iface *ifa)
{ ospf_send_to(ifa, ifa->all_routers); }