summaryrefslogtreecommitdiffstats
path: root/ospf6d/ospf6_abr.c
diff options
context:
space:
mode:
authorRenato Westphal <renato@opensourcerouting.org>2023-03-01 21:31:56 +0100
committerRenato Westphal <renato@opensourcerouting.org>2023-03-02 23:38:03 +0100
commit3a94ed56964097e35c932bafce0c164b9323c12d (patch)
tree7c89e28fc1491d4b72e808857f81c2c002e57f94 /ospf6d/ospf6_abr.c
parentospf6d: add exception for virtual links when exiting from the GR mode (diff)
downloadfrr-3a94ed56964097e35c932bafce0c164b9323c12d.tar.xz
frr-3a94ed56964097e35c932bafce0c164b9323c12d.zip
ospf6d: fix duplicate inter-area-prefix-LSAs after exiting from GR mode
An ABR that is originating inter-area-prefix-LSAs should take into account the fact that there might be self-originated LSAs for the same prefixes that were originated prior to a graceful restart. When that happens, the previous LSA-IDs should be reused to avoid having duplicate LSAs. Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
Diffstat (limited to 'ospf6d/ospf6_abr.c')
-rw-r--r--ospf6d/ospf6_abr.c16
1 files changed, 13 insertions, 3 deletions
diff --git a/ospf6d/ospf6_abr.c b/ospf6d/ospf6_abr.c
index 4def3c738..5b2b204dd 100644
--- a/ospf6d/ospf6_abr.c
+++ b/ospf6d/ospf6_abr.c
@@ -515,11 +515,21 @@ int ospf6_abr_originate_summary_to_area(struct ospf6_route *route,
summary->path.origin.id =
ADV_ROUTER_IN_PREFIX(&route->prefix);
} else {
+ struct ospf6_lsa *old;
+
summary->path.origin.type =
htons(OSPF6_LSTYPE_INTER_PREFIX);
- summary->path.origin.id = ospf6_new_ls_id(
- summary->path.origin.type,
- summary->path.origin.adv_router, area->lsdb);
+
+ /* Try to reuse LS-ID from previous running instance. */
+ old = ospf6_find_inter_prefix_lsa(area->ospf6, area,
+ &route->prefix);
+ if (old)
+ summary->path.origin.id = old->header->id;
+ else
+ summary->path.origin.id = ospf6_new_ls_id(
+ summary->path.origin.type,
+ summary->path.origin.adv_router,
+ area->lsdb);
}
summary = ospf6_route_add(summary, summary_table);
} else {