]> git.proxmox.com Git - mirror_frr.git/blobdiff - ospf6d/ospf6_flood.c
lib: add [XXXXX-XXXXX] log prefix & config
[mirror_frr.git] / ospf6d / ospf6_flood.c
index 85d02c186b70bf4ebe1ddc4227dc2ce4132e9742..2d896546faf5190313b7901024e88e6ddc316a4c 100644 (file)
@@ -332,11 +332,12 @@ void ospf6_flood_interface(struct ospf6_neighbor *from, struct ospf6_lsa *lsa,
                                        if (req == on->last_ls_req) {
                                                /* sanity check refcount */
                                                assert(req->lock >= 2);
-                                               ospf6_lsa_unlock(req);
+                                               req = ospf6_lsa_unlock(req);
                                                on->last_ls_req = NULL;
                                        }
-                                       ospf6_lsdb_remove(req,
-                                                         on->request_list);
+                                       if (req)
+                                               ospf6_lsdb_remove(
+                                                       req, on->request_list);
                                        ospf6_check_nbr_loading(on);
                                        continue;
                                }
@@ -348,7 +349,7 @@ void ospf6_flood_interface(struct ospf6_neighbor *from, struct ospf6_lsa *lsa,
                                                zlog_debug(
                                                        "Received is newer, remove requesting");
                                        if (req == on->last_ls_req) {
-                                               ospf6_lsa_unlock(req);
+                                               req = ospf6_lsa_unlock(req);
                                                on->last_ls_req = NULL;
                                        }
                                        if (req)
@@ -369,7 +370,7 @@ void ospf6_flood_interface(struct ospf6_neighbor *from, struct ospf6_lsa *lsa,
                        continue;
                }
 
-               if (ospf6->inst_shutdown) {
+               if (oi->area->ospf6->inst_shutdown) {
                        if (is_debug)
                                zlog_debug(
                                        "%s: Send LSA %s (age %d) update now",
@@ -451,12 +452,6 @@ void ospf6_flood_area(struct ospf6_neighbor *from, struct ospf6_lsa *lsa,
                    && oi != OSPF6_INTERFACE(lsa->lsdb->data))
                        continue;
 
-#if 0
-      if (OSPF6_LSA_SCOPE (lsa->header->type) == OSPF6_SCOPE_AS &&
-          ospf6_is_interface_virtual_link (oi))
-        continue;
-#endif /*0*/
-
                ospf6_flood_interface(from, lsa, oi);
        }
 }
@@ -485,6 +480,12 @@ static void ospf6_flood_process(struct ospf6_neighbor *from,
 
 void ospf6_flood(struct ospf6_neighbor *from, struct ospf6_lsa *lsa)
 {
+       struct ospf6 *ospf6;
+
+       ospf6 = ospf6_get_by_lsdb(lsa);
+       if (ospf6 == NULL)
+               return;
+
        ospf6_flood_process(from, lsa, ospf6);
 }
 
@@ -520,12 +521,6 @@ static void ospf6_flood_clear_area(struct ospf6_lsa *lsa, struct ospf6_area *oa)
                    && oi != OSPF6_INTERFACE(lsa->lsdb->data))
                        continue;
 
-#if 0
-      if (OSPF6_LSA_SCOPE (lsa->header->type) == OSPF6_SCOPE_AS &&
-          ospf6_is_interface_virtual_link (oi))
-        continue;
-#endif /*0*/
-
                ospf6_flood_clear_interface(lsa, oi);
        }
 }
@@ -554,6 +549,9 @@ static void ospf6_flood_clear_process(struct ospf6_lsa *lsa,
 
 void ospf6_flood_clear(struct ospf6_lsa *lsa)
 {
+       struct ospf6 *ospf6;
+
+       ospf6 = ospf6_get_by_lsdb(lsa);
        ospf6_flood_clear_process(lsa, ospf6);
 }
 
@@ -1000,18 +998,22 @@ void ospf6_receive_lsa(struct ospf6_neighbor *from,
                         * MAXAGEd and not removed.*/
                        if (OSPF6_LSA_IS_MAXAGE(old)
                            && !OSPF6_LSA_IS_MAXAGE(new)) {
-
-                               if (is_debug)
-                                       zlog_debug(
-                                               "%s: Current copy of LSA %s is MAXAGE, but new has recent Age.",
-                                               old->name, __func__);
-
-                               ospf6_lsa_purge(old);
                                if (new->header->adv_router
-                                   != from->ospf6_if->area->ospf6->router_id)
+                                   != from->ospf6_if->area->ospf6->router_id) {
+                                       if (is_debug)
+                                               zlog_debug(
+                                                       "%s: Current copy of LSA %s is MAXAGE, but new has recent age, flooding/installing.",
+                                                       old->name, __PRETTY_FUNCTION__);
+                                       ospf6_lsa_purge(old);
                                        ospf6_flood(from, new);
-
-                               ospf6_install_lsa(new);
+                                       ospf6_install_lsa(new);
+                               } else {
+                                       if (is_debug)
+                                               zlog_debug(
+                                                       "%s: Current copy of self-originated LSA %s is MAXAGE, but new has recent age, ignoring new.",
+                                                       old->name, __PRETTY_FUNCTION__);
+                                       ospf6_lsa_delete(new);
+                               }
                                return;
                        }