summaryrefslogtreecommitdiffstats
path: root/ospfd/ospf_lsdb.c
diff options
context:
space:
mode:
authorManoj Naragund <mnaragund@vmware.com>2022-11-21 13:50:16 +0100
committerManoj Naragund <mnaragund@vmware.com>2023-01-20 06:03:03 +0100
commit516c4c665aaf8608b340259b8125c149136d89c9 (patch)
tree1189a85fad1104aed4e820ed5260d841d5180b84 /ospfd/ospf_lsdb.c
parentospfd: ospf hello changes. (diff)
downloadfrr-516c4c665aaf8608b340259b8125c149136d89c9.tar.xz
frr-516c4c665aaf8608b340259b8125c149136d89c9.zip
ospfd: Core logic implementation.
Description: Code changes involves. 1. Count the no.of router LSAs received with DC options bit set, supporting do not age(DNA). 2. If no of router LSAs received with DC bit set is equal to total no of LSAs in the router lsdb, then all the routers in the area support do not age processing. 3. Flood the self originated LSAs with DNA flag if all routers in the area supports the feature. 4. Stop aging of the LSAs recived with DO_NOT_AGE bit set from other routers. 5. Self originated DO_NOT_AGE lsas will still be aging in their own database. Signed-off-by: Manoj Naragund <mnaragund@vmware.com>
Diffstat (limited to 'ospfd/ospf_lsdb.c')
-rw-r--r--ospfd/ospf_lsdb.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/ospfd/ospf_lsdb.c b/ospfd/ospf_lsdb.c
index f4fb858a5..d55705b74 100644
--- a/ospfd/ospf_lsdb.c
+++ b/ospfd/ospf_lsdb.c
@@ -92,6 +92,21 @@ static void ospf_lsdb_delete_entry(struct ospf_lsdb *lsdb,
lsdb->type[lsa->data->type].count--;
lsdb->type[lsa->data->type].checksum -= ntohs(lsa->data->checksum);
lsdb->total--;
+
+ /* Decrement number of router LSAs received with DC bit set */
+ if (lsa->area && (lsa->area->lsdb == lsdb) && !IS_LSA_SELF(lsa) &&
+ (lsa->data->type == OSPF_ROUTER_LSA) &&
+ CHECK_FLAG(lsa->data->options, OSPF_OPTION_DC))
+ lsa->area->fr_info.router_lsas_recv_dc_bit--;
+
+ /*
+ * If the LSA being deleted is indication LSA, then set the
+ * pointer to NULL.
+ */
+ if (lsa->area && lsa->area->fr_info.indication_lsa_self &&
+ (lsa->area->fr_info.indication_lsa_self == lsa))
+ lsa->area->fr_info.indication_lsa_self = NULL;
+
rn->info = NULL;
route_unlock_node(rn);
#ifdef MONITOR_LSDB_CHANGE
@@ -128,6 +143,12 @@ void ospf_lsdb_add(struct ospf_lsdb *lsdb, struct ospf_lsa *lsa)
lsdb->type[lsa->data->type].count++;
lsdb->total++;
+ /* Increment number of router LSAs received with DC bit set */
+ if (lsa->area && (lsa->area->lsdb == lsdb) && !IS_LSA_SELF(lsa) &&
+ (lsa->data->type == OSPF_ROUTER_LSA) &&
+ CHECK_FLAG(lsa->data->options, OSPF_OPTION_DC))
+ lsa->area->fr_info.router_lsas_recv_dc_bit++;
+
#ifdef MONITOR_LSDB_CHANGE
if (lsdb->new_lsa_hook != NULL)
(*lsdb->new_lsa_hook)(lsa);