summaryrefslogtreecommitdiffstats
path: root/ospf6d
diff options
context:
space:
mode:
authorckishimo <carles.kishimoto@gmail.com>2021-11-27 00:14:07 +0100
committerckishimo <carles.kishimoto@gmail.com>2022-01-05 18:19:32 +0100
commit35ee59fb57cfb36732a54c6514a0f5cb381b79fa (patch)
tree32d7d4933c0e6933dddf7aba91d99598658a73d1 /ospf6d
parentMerge pull request #9878 from pguibert6WIND/resolver_vrf (diff)
downloadfrr-35ee59fb57cfb36732a54c6514a0f5cb381b79fa.tar.xz
frr-35ee59fb57cfb36732a54c6514a0f5cb381b79fa.zip
ospf6d: stop refreshing type-5 from NSSA
With the current code, in a topology like this: r1 ---- 0.0.0.0 ---- r2(ABR) ---- 1.1.1.1 -----r3(ASBR) NSSA where r3 is redistributing statics within the NSSA area, the ABR (r2) is translating type-7 lsa to type-5. Everytime the function ospf6_abr_nssa_task() is executed all translated type-5 are aged out and refreshed for no reason. So for instance having 3 lsas already advertised: r1# sh ipv6 os database AS Scoped Link State Database Type LSId AdvRouter Age SeqNum Payload ASE 0.0.0.1 2.2.2.2 39 80000001 3:3::3/128 ASE 0.0.0.2 2.2.2.2 39 80000001 4:4::4/128 ASE 0.0.0.3 2.2.2.2 39 80000001 5:5::5/128 Adversting a new route from r3: r3(config)# ipv6 route 6:6::6/128 Null0 r1# sh ipv6 os database AS Scoped Link State Database Type LSId AdvRouter Age SeqNum Payload ASE 0.0.0.1 2.2.2.2 124 80000001 3:3::3/128 ASE 0.0.0.2 2.2.2.2 124 80000001 4:4::4/128 ASE 0.0.0.3 2.2.2.2 124 80000001 5:5::5/128 ASE 0.0.0.4 2.2.2.2 8 80000001 6:6::6/128 That seems okay, however a few seconds later we see all prefixes refreshed r1# sh ipv6 os database AS Scoped Link State Database Type LSId AdvRouter Age SeqNum Payload ASE 0.0.0.1 2.2.2.2 3600 80000001 3:3::3/128 ASE 0.0.0.2 2.2.2.2 3600 80000001 4:4::4/128 ASE 0.0.0.3 2.2.2.2 3600 80000001 5:5::5/128 ASE 0.0.0.4 2.2.2.2 3600 80000001 6:6::6/128 ASE 0.0.0.5 2.2.2.2 3 80000001 3:3::3/128 ASE 0.0.0.6 2.2.2.2 3 80000001 4:4::4/128 ASE 0.0.0.7 2.2.2.2 3 80000001 5:5::5/128 ASE 0.0.0.8 2.2.2.2 3 80000001 6:6::6/128 This PR prevents the LSA of being refreshed by unsetting the OSPF6_LSA_UNAPPROVED flag so advertising the last prefix will not refresh all of them: r1# sh ipv6 os database AS Scoped Link State Database Type LSId AdvRouter Age SeqNum Payload ASE 0.0.0.1 2.2.2.2 90 80000001 3:3::3/128 ASE 0.0.0.2 2.2.2.2 47 80000001 4:4::4/128 ASE 0.0.0.3 2.2.2.2 35 80000001 5:5::5/128 ASE 0.0.0.4 2.2.2.2 7 80000001 6:6::6/128 Signed-off-by: ckishimo <carles.kishimoto@gmail.com>
Diffstat (limited to 'ospf6d')
-rw-r--r--ospf6d/ospf6_nssa.c25
1 files changed, 10 insertions, 15 deletions
diff --git a/ospf6d/ospf6_nssa.c b/ospf6d/ospf6_nssa.c
index cd1be3a5b..7d85b3298 100644
--- a/ospf6d/ospf6_nssa.c
+++ b/ospf6d/ospf6_nssa.c
@@ -625,7 +625,7 @@ static void ospf6_abr_translate_nssa(struct ospf6_area *area, struct ospf6_lsa *
* Later, any Unapproved Translated Type-5's are flushed/discarded
*/
- struct ospf6_lsa *old = NULL, *new = NULL;
+ struct ospf6_lsa *old = NULL;
struct ospf6_as_external_lsa *nssa_lsa;
struct prefix prefix;
struct ospf6_route *match;
@@ -662,11 +662,11 @@ static void ospf6_abr_translate_nssa(struct ospf6_area *area, struct ospf6_lsa *
}
/* Find the existing AS-External LSA for this prefix */
- match = ospf6_route_lookup(&prefix, ospf6->external_table);
+ match = ospf6_route_lookup(&prefix, ospf6->route_table);
if (match) {
- old = ospf6_lsdb_lookup(OSPF6_LSTYPE_AS_EXTERNAL,
- match->path.origin.id, ospf6->router_id,
- ospf6->lsdb);
+ old = ospf6_lsdb_lookup(htons(OSPF6_LSTYPE_AS_EXTERNAL),
+ lsa->external_lsa_id, ospf6->router_id,
+ ospf6->lsdb);
}
if (OSPF6_LSA_IS_MAXAGE(lsa)) {
@@ -675,20 +675,15 @@ static void ospf6_abr_translate_nssa(struct ospf6_area *area, struct ospf6_lsa *
return;
}
- if (old) {
+ if (old && !OSPF6_LSA_IS_MAXAGE(old)) {
if (IS_OSPF6_DEBUG_NSSA)
zlog_debug(
- "%s : found old translated LSA Id %pI4, refreshing",
+ "%s : found old translated LSA Id %pI4, skip",
__func__, &old->header->id);
- /* refresh */
- new = ospf6_translated_nssa_refresh(area, lsa, old);
- if (!new) {
- if (IS_OSPF6_DEBUG_NSSA)
- zlog_debug(
- "%s : could not refresh translated LSA Id %pI4",
- __func__, &old->header->id);
- }
+ UNSET_FLAG(old->flag, OSPF6_LSA_UNAPPROVED);
+ return;
+
} else {
/* no existing external route for this LSA Id
* originate translated LSA