From 5a0e96e65bad2954587f17a8f6a93d466e4af052 Mon Sep 17 00:00:00 2001 From: ckishimo Date: Mon, 8 Nov 2021 23:53:02 +0100 Subject: [PATCH 1/2] ospf6d: do not originate Type-4 for NSSA ASBR In a topology like: r1 ---- 0.0.0.0 ---- r2(ABR) ---- 1.1.1.1 -----r3(ASBR) where r3 is redistributing statics and area 1.1.1.1 is NSSA, the ABR r2 should not originate type-4 LSA, according to RFC 3101, section 1.3: "also an NSSA's border routers never originate Type-4 summary-LSAs for the NSSA's AS boundary routers, since Type-7 AS-external-LSAs are never flooded beyond the NSSA's border" r1# sh ipv6 os database inter-router Area Scoped Link State Database (Area 0.0.0.0) Type LSId AdvRouter Age SeqNum Payload IAR 3.3.3.3 2.2.2.2 49 80000001 3.3.3.3 This PR prevents the above LSA of being originated by the ABR r2 Signed-off-by: ckishimo --- ospf6d/ospf6_abr.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/ospf6d/ospf6_abr.c b/ospf6d/ospf6_abr.c index a9b4c7756c..b60cf7125a 100644 --- a/ospf6d/ospf6_abr.c +++ b/ospf6d/ospf6_abr.c @@ -447,6 +447,18 @@ int ospf6_abr_originate_summary_to_area(struct ospf6_route *route, return 0; } + /* Do not generate if area is NSSA */ + route_area = + ospf6_area_lookup(route->path.area_id, area->ospf6); + if (IS_AREA_NSSA(route_area)) { + if (is_debug) + zlog_debug( + "%s: The route comes from NSSA area, skip", + __func__); + ospf6_abr_delete_route(summary, summary_table, old); + return 0; + } + /* Do not generate if the area is stub */ /* XXX */ } From c01326c6fb26a19677f70f99bc5edc22babadcc8 Mon Sep 17 00:00:00 2001 From: ckishimo Date: Tue, 9 Nov 2021 00:07:35 +0100 Subject: [PATCH 2/2] ospf6d: do not originate Type-4 into NSSA In a topology like: r1(ASBR) ---- 0.0.0.0 ---- r2(ABR) ---- 1.1.1.1 -----r3 where r1 is redistributing statics and area 1.1.1.1 is NSSA, the ABR r2 should not originate type-4 LSA into the NSSA area. From RFC 3101: "NSSA border routers should not originate Type-4 summary-LSAs into their NSSAs." This PR prevents the above LSA of being originated by the ABR r2 Signed-off-by: ckishimo --- ospf6d/ospf6_abr.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ospf6d/ospf6_abr.c b/ospf6d/ospf6_abr.c index b60cf7125a..5d9e315adb 100644 --- a/ospf6d/ospf6_abr.c +++ b/ospf6d/ospf6_abr.c @@ -394,7 +394,8 @@ int ospf6_abr_originate_summary_to_area(struct ospf6_route *route, return 0; } - if ((route->type == OSPF6_DEST_TYPE_ROUTER) && IS_AREA_STUB(area)) { + if ((route->type == OSPF6_DEST_TYPE_ROUTER) + && (IS_AREA_STUB(area) || IS_AREA_NSSA(area))) { if (is_debug) zlog_debug( "Area has been stubbed, purge Inter-Router LSA");