From 4aa200c7c55c84033a804d7c37847790c936e256 Mon Sep 17 00:00:00 2001 From: David Lamparter Date: Thu, 25 Apr 2024 12:16:35 +0200 Subject: [PATCH 1/3] ospf6d: fix loopback/ptp/ptmp conn. route checks The code emitting connected routes was checking against the interface state (which can also be lo/ptp/ptmp) rather than the interface type. This was causing wrong IA prefixes for connected routes getting put up out if the interface was down intermittently. Signed-off-by: David Lamparter --- ospf6d/ospf6_interface.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/ospf6d/ospf6_interface.c b/ospf6d/ospf6_interface.c index a4f4e8fcab..c9ba5a81f7 100644 --- a/ospf6d/ospf6_interface.c +++ b/ospf6d/ospf6_interface.c @@ -455,9 +455,9 @@ void ospf6_interface_connected_route_update(struct interface *ifp) } } - if (oi->state == OSPF6_INTERFACE_LOOPBACK || - oi->state == OSPF6_INTERFACE_POINTTOMULTIPOINT || - oi->state == OSPF6_INTERFACE_POINTTOPOINT) { + if (oi->type == OSPF_IFTYPE_LOOPBACK || + oi->type == OSPF_IFTYPE_POINTOMULTIPOINT || + oi->type == OSPF_IFTYPE_POINTOPOINT) { struct ospf6_route *la_route; la_route = ospf6_route_create(oi->area->ospf6); @@ -475,10 +475,10 @@ void ospf6_interface_connected_route_update(struct interface *ifp) ospf6_route_add(la_route, oi->route_connected); } - if (oi->state == OSPF6_INTERFACE_POINTTOMULTIPOINT && + if (oi->type == OSPF_IFTYPE_POINTOMULTIPOINT && !oi->p2xp_connected_pfx_include) continue; - if (oi->state == OSPF6_INTERFACE_POINTTOPOINT && + if (oi->type == OSPF_IFTYPE_POINTOPOINT && oi->p2xp_connected_pfx_exclude) continue; From d7f54c4d5692c85d0f6a5bb384b156f252b92e20 Mon Sep 17 00:00:00 2001 From: David Lamparter Date: Thu, 25 Apr 2024 12:18:08 +0200 Subject: [PATCH 2/3] ospf6d: force recalculate on interface_up interface_up also handles changes to the interface type, i.e. broadcast to ptp to ptmp. Connected routes for these are different and must be readvertised, which is done in ospf6_interface_recalculate_cost() - but only if the cost changed. Use the force variant here. Signed-off-by: David Lamparter --- ospf6d/ospf6_interface.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ospf6d/ospf6_interface.c b/ospf6d/ospf6_interface.c index c9ba5a81f7..8549af06ec 100644 --- a/ospf6d/ospf6_interface.c +++ b/ospf6d/ospf6_interface.c @@ -792,8 +792,8 @@ void interface_up(struct event *thread) return; } - /* Recompute cost */ - ospf6_interface_recalculate_cost(oi); + /* Recompute cost & update connected LSAs */ + ospf6_interface_force_recalculate_cost(oi); /* if already enabled, do nothing */ if (oi->state > OSPF6_INTERFACE_DOWN) { From 52734fc8e5dad3569c3c37251f6dcc7a83c07299 Mon Sep 17 00:00:00 2001 From: David Lamparter Date: Thu, 25 Apr 2024 12:20:27 +0200 Subject: [PATCH 3/3] ospf6d: accept CLI `no` for point-to-multipoint `point-to-multipoint` was missing on the removal variant of this CLI command. Signed-off-by: David Lamparter --- ospf6d/ospf6_interface.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/ospf6d/ospf6_interface.c b/ospf6d/ospf6_interface.c index 8549af06ec..7f813ce3cc 100644 --- a/ospf6d/ospf6_interface.c +++ b/ospf6d/ospf6_interface.c @@ -2644,13 +2644,14 @@ DEFUN (ipv6_ospf6_network, DEFUN (no_ipv6_ospf6_network, no_ipv6_ospf6_network_cmd, - "no ipv6 ospf6 network []", + "no ipv6 ospf6 network []", NO_STR IP6_STR OSPF6_STR "Set default network type\n" "Specify OSPF6 broadcast network\n" - "Specify OSPF6 point-to-point network\n") + "Specify OSPF6 point-to-point network\n" + "Specify OSPF6 point-to-multipoint network\n") { VTY_DECLVAR_CONTEXT(interface, ifp); struct ospf6_interface *oi;