[PATCH] OSPF: on PtP ospf_iface with physical PtP links, skip next-hop resolving
Soha Jin
soha at jin.sh
Sun Nov 5 17:35:50 CET 2023
Signed-off-by: Soha Jin <soha at jin.sh>
Co-developed-by: Wende Tan <twd2.me at gmail.com>
---
proto/ospf/rt.c | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/proto/ospf/rt.c b/proto/ospf/rt.c
index 471bb586..02b2f214 100644
--- a/proto/ospf/rt.c
+++ b/proto/ospf/rt.c
@@ -1796,7 +1796,12 @@ calc_next_hop(struct ospf_area *oa, struct top_hash_entry *en,
if (ifa->type == OSPF_IT_VLINK)
return new_nexthop(p, IPA_NONE, NULL, 0);
- /* FIXME: On physical PtP links we may skip next-hop altogether */
+ /*
+ * The type of the ospf_iface is PtP and the iface has a physical PtP link,
+ * so we can simply use the iface, and skip further resolving.
+ */
+ if (ifa->type == OSPF_IT_PTP && !(ifa->iface->flags & IF_MULTIACCESS))
+ return new_nexthop(p, IPA_NONE, ifa->iface, ifa->ecmp_weight);
if (ospf_is_v2(p) || ospf_is_ip6(p))
{
--
2.39.2
More information about the Bird-users
mailing list