mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-08-07 06:03:10 +00:00
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>
This commit is contained in:
parent
e2144103f8
commit
35ee59fb57
@ -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
|
* 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 ospf6_as_external_lsa *nssa_lsa;
|
||||||
struct prefix prefix;
|
struct prefix prefix;
|
||||||
struct ospf6_route *match;
|
struct ospf6_route *match;
|
||||||
@ -662,10 +662,10 @@ static void ospf6_abr_translate_nssa(struct ospf6_area *area, struct ospf6_lsa *
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Find the existing AS-External LSA for this prefix */
|
/* 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) {
|
if (match) {
|
||||||
old = ospf6_lsdb_lookup(OSPF6_LSTYPE_AS_EXTERNAL,
|
old = ospf6_lsdb_lookup(htons(OSPF6_LSTYPE_AS_EXTERNAL),
|
||||||
match->path.origin.id, ospf6->router_id,
|
lsa->external_lsa_id, ospf6->router_id,
|
||||||
ospf6->lsdb);
|
ospf6->lsdb);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -675,20 +675,15 @@ static void ospf6_abr_translate_nssa(struct ospf6_area *area, struct ospf6_lsa *
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (old) {
|
if (old && !OSPF6_LSA_IS_MAXAGE(old)) {
|
||||||
if (IS_OSPF6_DEBUG_NSSA)
|
if (IS_OSPF6_DEBUG_NSSA)
|
||||||
zlog_debug(
|
zlog_debug(
|
||||||
"%s : found old translated LSA Id %pI4, refreshing",
|
"%s : found old translated LSA Id %pI4, skip",
|
||||||
__func__, &old->header->id);
|
__func__, &old->header->id);
|
||||||
|
|
||||||
/* refresh */
|
UNSET_FLAG(old->flag, OSPF6_LSA_UNAPPROVED);
|
||||||
new = ospf6_translated_nssa_refresh(area, lsa, old);
|
return;
|
||||||
if (!new) {
|
|
||||||
if (IS_OSPF6_DEBUG_NSSA)
|
|
||||||
zlog_debug(
|
|
||||||
"%s : could not refresh translated LSA Id %pI4",
|
|
||||||
__func__, &old->header->id);
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
/* no existing external route for this LSA Id
|
/* no existing external route for this LSA Id
|
||||||
* originate translated LSA
|
* originate translated LSA
|
||||||
|
Loading…
Reference in New Issue
Block a user