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.c80
1 files changed, 79 insertions, 1 deletions
diff --git a/ospf6d/ospf6_flood.c b/ospf6d/ospf6_flood.c
index 3d52597161..f13ed3e3bb 100644
--- a/ospf6d/ospf6_flood.c
+++ b/ospf6d/ospf6_flood.c
@@ -41,6 +41,7 @@
#include "ospf6_flood.h"
#include "ospf6_nssa.h"
+#include "ospf6_gr.h"
unsigned char conf_debug_ospf6_flooding;
@@ -169,9 +170,26 @@ void ospf6_remove_id_from_external_id_table(struct ospf6 *ospf6,
void ospf6_external_lsa_purge(struct ospf6 *ospf6, struct ospf6_lsa *lsa)
{
+ uint32_t id = lsa->header->id;
+ struct ospf6_area *oa;
+ struct listnode *lnode;
+
ospf6_lsa_purge(lsa);
- ospf6_remove_id_from_external_id_table(ospf6, lsa->header->id);
+ 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,
+ ospf6->router_id, oa->lsdb);
+ if (lsa) {
+ if (IS_OSPF6_DEBUG_NSSA)
+ zlog_debug("withdraw type 7 lsa, LS ID: %u",
+ htonl(id));
+
+ ospf6_lsa_purge(lsa);
+ }
+ }
}
void ospf6_lsa_purge(struct ospf6_lsa *lsa)
@@ -306,6 +324,22 @@ void ospf6_install_lsa(struct ospf6_lsa *lsa)
/* actually install */
lsa->installed = now;
+
+ /* Topo change handling */
+ if (CHECK_LSA_TOPO_CHG_ELIGIBLE(ntohs(lsa->header->type))) {
+
+ /* 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);
+
+ ospf6_helper_handle_topo_chg(ospf6, lsa);
+ }
+ }
+
ospf6_lsdb_add(lsa, lsa->lsdb);
if (ntohs(lsa->header->type) == OSPF6_LSTYPE_TYPE_7) {
@@ -999,6 +1033,50 @@ void ospf6_receive_lsa(struct ospf6_neighbor *from,
!= from->ospf6_if->area->ospf6->router_id)
ospf6_flood(from, new);
+ /* Received Grace-LSA */
+ if (IS_GRACE_LSA(new)) {
+ struct ospf6 *ospf6;
+
+ ospf6 = ospf6_get_by_lsdb(new);
+
+ assert(ospf6);
+
+ if (OSPF6_LSA_IS_MAXAGE(new)) {
+
+ if (IS_DEBUG_OSPF6_GR)
+ zlog_debug(
+ "%s, Received a maxage GraceLSA from router %pI4",
+ __func__,
+ &new->header->adv_router);
+ if (old) {
+ ospf6_process_maxage_grace_lsa(
+ ospf6, new, from);
+ } else {
+ if (IS_DEBUG_OSPF6_GR)
+ zlog_debug(
+ "%s, GraceLSA doesn't exist in lsdb, so discarding GraceLSA",
+ __func__);
+ return;
+ }
+ } else {
+
+ if (IS_DEBUG_OSPF6_GR)
+ zlog_debug(
+ "%s, Received a GraceLSA from router %pI4",
+ __func__,
+ &new->header->adv_router);
+
+ if (ospf6_process_grace_lsa(ospf6, new, from)
+ == OSPF6_GR_NOT_HELPER) {
+ if (IS_DEBUG_OSPF6_GR)
+ zlog_debug(
+ "%s, Not moving to HELPER role, So dicarding GraceLSA",
+ __func__);
+ return;
+ }
+ }
+ }
+
/* (d), installing lsdb, which may cause routing
table calculation (replacing database copy) */
ospf6_install_lsa(new);