From c1632ad0f39f7221d649a9e469cacc38105528e2 Mon Sep 17 00:00:00 2001 From: "Ondrej Zajicek (work)" Date: Tue, 26 May 2020 18:21:43 +0200 Subject: [PATCH] OSPF: Fix handling of unnumbered PtPs This issue has a long history. In 2012, we changed data field for unnumbered PtP links from iface id (specified by RFC) to IP address based on reports of bugs in Quagga that required it, and we used out-of-band information to distinquish unnumberred PtPs with the same local IP address. Then with OSPF graceful restart implementation, we found that we can no longer use out-of-band information, and we need to use only LSAdb info for routing table calculation, but i forgot to finish handling of this case, so multiple unnumbered PtPs with the same local IP addresses were broken. Considering that even recent Mikrotik RouterOS has broken next hop calculation that depends on IP address in PtP link data field, we cannot just switch back to the iface id for unnumbered PtP links. The patch makes two changes: First, it goes back to use out-of-band (position) info for distinguishing local interfaces in SPF when graceful restart is not enabled, while still uses LSAdb-only approach for SPF calculation when graceful restart is enabled. Second, it adds OSPF interface option 'ptp address', which controls whether IP address or iface id is used in data field. It is enabled by default except for unnumbered PtP links with enabled graceful restart. Thanks to Kenth Eriksson for the bugreport and Joakim Tjernlund for suggestions. --- doc/bird.sgml | 27 ++++++++++++++++++++++----- proto/ospf/config.Y | 4 +++- proto/ospf/iface.c | 28 ++++++++++++++++++++++++++++ proto/ospf/ospf.h | 16 ++++++++++++++++ proto/ospf/rt.c | 12 ++++++++---- proto/ospf/topology.c | 11 ++++------- 6 files changed, 81 insertions(+), 17 deletions(-) diff --git a/doc/bird.sgml b/doc/bird.sgml index 401b4035..552f6509 100644 --- a/doc/bird.sgml +++ b/doc/bird.sgml @@ -3760,11 +3760,28 @@ protocol ospf [v2|v3] <name> { In