summaryrefslogtreecommitdiff
path: root/ospf6d
diff options
context:
space:
mode:
authorckishimo <carles.kishimoto@gmail.com>2022-01-05 20:27:55 +0100
committerCarles Kishimoto Bisbe <carles.kishimoto@cern.ch>2022-03-28 22:19:27 +0200
commit3cd5108d828b5c6a0c4b0f28c984846750d3734b (patch)
tree17bb1dee452dea3a18d294a6d255773aa9a32039 /ospf6d
parent35ee59fb57cfb36732a54c6514a0f5cb381b79fa (diff)
ospf6d: fix NSSA area-range command
When an area-range command is applied in an ABR, the more specific prefixes need to be removed. r2# sh ipv6 ospf database AS Scoped Link State Database Type LSId AdvRouter Age SeqNum Payload ASE 0.0.0.1 10.254.254.2 53 80000001 :: ASE 0.0.0.2 10.254.254.2 51 80000001 2001:db8:1::/64 ASE 0.0.0.3 10.254.254.2 51 80000001 2001:db8:3::/64 ASE 0.0.0.4 10.254.254.2 51 80000001 2001:db8:2::/64 ASE 0.0.0.5 10.254.254.2 46 80000001 2001:db8:1::/64 ASE 0.0.0.6 10.254.254.2 46 80000001 2001:db8:3::/64 ASE 0.0.0.7 10.254.254.2 46 80000001 2001:db8:2::/64 ASE 0.0.0.8 10.254.254.2 41 80000001 2001:db8:3::/64 ASE 0.0.0.9 10.254.254.2 41 80000001 2001:db8:1000::1/128 <-- ** ASE 0.0.0.10 10.254.254.2 41 80000001 2001:db8:1000::2/128 <-- ** ASE 0.0.0.12 10.254.254.2 24 80000001 2001:db8:1000::/64 ASE 0.0.0.1 10.254.254.3 52 80000001 2001:db8:2::/64 Signed-off-by: ckishimo <carles.kishimoto@gmail.com>
Diffstat (limited to 'ospf6d')
-rw-r--r--ospf6d/ospf6_nssa.c32
1 files changed, 29 insertions, 3 deletions
diff --git a/ospf6d/ospf6_nssa.c b/ospf6d/ospf6_nssa.c
index 7d85b32986..5c3d31dda8 100644
--- a/ospf6d/ospf6_nssa.c
+++ b/ospf6d/ospf6_nssa.c
@@ -613,7 +613,8 @@ struct ospf6_lsa *ospf6_translated_nssa_refresh(struct ospf6_area *area,
return new;
}
-static void ospf6_abr_translate_nssa(struct ospf6_area *area, struct ospf6_lsa *lsa)
+static void ospf6_abr_translate_nssa(struct ospf6_area *area,
+ struct ospf6_lsa *lsa)
{
/* Incoming Type-7 or later aggregated Type-7
*
@@ -661,12 +662,37 @@ static void ospf6_abr_translate_nssa(struct ospf6_area *area, struct ospf6_lsa *
return;
}
+ /* Find the type-5 LSA in the area-range table */
+ match = ospf6_route_lookup_bestmatch(&prefix, area->nssa_range_table);
+ if (match && CHECK_FLAG(match->flag, OSPF6_ROUTE_NSSA_RANGE)) {
+ if (prefix_same(&prefix, &match->prefix)) {
+ /* The prefix range is being removed,
+ * no need to refresh
+ */
+ if
+ CHECK_FLAG(match->flag, OSPF6_ROUTE_REMOVE)
+ return;
+ } else {
+ if (!CHECK_FLAG(match->flag, OSPF6_ROUTE_REMOVE)) {
+ if (IS_OSPF6_DEBUG_NSSA)
+ zlog_debug(
+ "%s: LSA Id %pI4 suppressed by range %pFX of area %s",
+ __func__, &lsa->header->id,
+ &match->prefix, area->name);
+ /* LSA will be suppressed by area-range command,
+ * no need to refresh
+ */
+ return;
+ }
+ }
+ }
+
/* Find the existing AS-External LSA for this prefix */
match = ospf6_route_lookup(&prefix, ospf6->route_table);
if (match) {
old = ospf6_lsdb_lookup(htons(OSPF6_LSTYPE_AS_EXTERNAL),
- lsa->external_lsa_id, ospf6->router_id,
- ospf6->lsdb);
+ lsa->external_lsa_id, ospf6->router_id,
+ ospf6->lsdb);
}
if (OSPF6_LSA_IS_MAXAGE(lsa)) {