diff options
author | Ondrej Zajicek (work) <santiago@crfreenet.org> | 2021-05-09 15:16:13 +0200 |
---|---|---|
committer | Ondrej Zajicek (work) <santiago@crfreenet.org> | 2021-05-09 15:26:13 +0200 |
commit | bc591061f618cdc35cf21c7973a660f8d7018b43 (patch) | |
tree | 003c26b28e57193c14a7598e1ed757427b8b26b6 /proto/ospf/packet.c | |
parent | 1647923bd8d2f8e53337365abc5be7e343aa570c (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/packet.c')
-rw-r--r-- | proto/ospf/packet.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/proto/ospf/packet.c b/proto/ospf/packet.c index 1f471d79..15242318 100644 --- a/proto/ospf/packet.c +++ b/proto/ospf/packet.c @@ -695,6 +695,14 @@ ospf_send_to_adjacent(struct ospf_iface *ifa) void ospf_send_to_iface(struct ospf_iface *ifa) { + /* + * Send packet to (relevant) neighbors on iface + * + * On broadcast networks, destination is either AllSPFRouters, or AllDRouters. + * On PtP networks, destination is always AllSPFRouters. On non-broadcast + * networks, packets are sent as unicast to every adjacent neighbor. + */ + if (ifa->type == OSPF_IT_BCAST) { if ((ifa->state == OSPF_IS_DR) || (ifa->state == OSPF_IS_BACKUP)) @@ -702,6 +710,8 @@ ospf_send_to_iface(struct ospf_iface *ifa) else ospf_send_to_designated(ifa); } + else if (ifa->type == OSPF_IT_PTP) + ospf_send_to_all(ifa); else /* Non-broadcast */ ospf_send_to_adjacent(ifa); } |