summaryrefslogtreecommitdiff
path: root/ospf6d/ospf6_flood.c
diff options
context:
space:
mode:
Diffstat (limited to 'ospf6d/ospf6_flood.c')
-rw-r--r--ospf6d/ospf6_flood.c36
1 files changed, 7 insertions, 29 deletions
diff --git a/ospf6d/ospf6_flood.c b/ospf6d/ospf6_flood.c
index 150903a56a..5fed6dfe17 100644
--- a/ospf6d/ospf6_flood.c
+++ b/ospf6d/ospf6_flood.c
@@ -151,24 +151,6 @@ void ospf6_lsa_originate_interface(struct ospf6_lsa *lsa,
ospf6_lsa_originate(oi->area->ospf6, lsa);
}
-void ospf6_remove_id_from_external_id_table(struct ospf6 *ospf6,
- uint32_t id)
-{
- struct prefix prefix_id;
- struct route_node *node;
-
- /* remove binding in external_id_table */
- prefix_id.family = AF_INET;
- prefix_id.prefixlen = 32;
- prefix_id.u.prefix4.s_addr = id;
- node = route_node_lookup(ospf6->external_id_table, &prefix_id);
- assert(node);
- node->info = NULL;
- route_unlock_node(node); /* to free the lookup lock */
- route_unlock_node(node); /* to free the original lock */
-
-}
-
void ospf6_external_lsa_purge(struct ospf6 *ospf6, struct ospf6_lsa *lsa)
{
uint32_t id = lsa->header->id;
@@ -177,8 +159,6 @@ void ospf6_external_lsa_purge(struct ospf6 *ospf6, struct ospf6_lsa *lsa)
ospf6_lsa_purge(lsa);
- ospf6_remove_id_from_external_id_table(ospf6, id);
-
/* Delete the corresponding NSSA LSA */
for (ALL_LIST_ELEMENTS_RO(ospf6->area_list, lnode, oa)) {
lsa = ospf6_lsdb_lookup(htons(OSPF6_LSTYPE_TYPE_7), id,
@@ -266,10 +246,14 @@ void ospf6_decrement_retrans_count(struct ospf6_lsa *lsa)
/* RFC2328 section 13.2 Installing LSAs in the database */
void ospf6_install_lsa(struct ospf6_lsa *lsa)
{
+ struct ospf6 *ospf6;
struct timeval now;
struct ospf6_lsa *old;
struct ospf6_area *area = NULL;
+ ospf6 = ospf6_get_by_lsdb(lsa);
+ assert(ospf6);
+
/* Remove the old instance from all neighbors' Link state
retransmission list (RFC2328 13.2 last paragraph) */
old = ospf6_lsdb_lookup(lsa->header->type, lsa->header->id,
@@ -330,20 +314,14 @@ void ospf6_install_lsa(struct ospf6_lsa *lsa)
&& !CHECK_FLAG(lsa->flag, OSPF6_LSA_DUPLICATE)) {
/* check if it is new lsa ? or existing lsa got modified ?*/
- if (!old || OSPF6_LSA_IS_CHANGED(old, lsa)) {
- struct ospf6 *ospf6;
-
- ospf6 = ospf6_get_by_lsdb(lsa);
-
- assert(ospf6);
-
+ if (!old || OSPF6_LSA_IS_CHANGED(old, lsa))
ospf6_helper_handle_topo_chg(ospf6, lsa);
- }
}
ospf6_lsdb_add(lsa, lsa->lsdb);
- if (ntohs(lsa->header->type) == OSPF6_LSTYPE_TYPE_7) {
+ if (ntohs(lsa->header->type) == OSPF6_LSTYPE_TYPE_7
+ && lsa->header->adv_router != ospf6->router_id) {
area = OSPF6_AREA(lsa->lsdb->data);
ospf6_translated_nssa_refresh(area, lsa, NULL);
ospf6_schedule_abr_task(area->ospf6);