]> git.proxmox.com Git - mirror_frr.git/blobdiff - ospf6d/ospf6_lsdb.c
*: Convert thread_execute to event_execute
[mirror_frr.git] / ospf6d / ospf6_lsdb.c
index 0221102b59f5ce20e78355e6189435e526c676e0..817949f0199b0799ecafeb831fe33429db15bb25 100644 (file)
 #include "vty.h"
 
 #include "ospf6_proto.h"
+#include "ospf6_area.h"
 #include "ospf6_lsa.h"
 #include "ospf6_lsdb.h"
+#include "ospf6_abr.h"
 #include "ospf6_asbr.h"
 #include "ospf6_route.h"
 #include "ospf6d.h"
@@ -216,6 +218,31 @@ struct ospf6_lsa *ospf6_find_external_lsa(struct ospf6 *ospf6, struct prefix *p)
        return lsa;
 }
 
+struct ospf6_lsa *ospf6_find_inter_prefix_lsa(struct ospf6 *ospf6,
+                                             struct ospf6_area *area,
+                                             struct prefix *p)
+{
+       struct ospf6_lsa *lsa;
+       uint16_t type = htons(OSPF6_LSTYPE_INTER_PREFIX);
+
+       for (ALL_LSDB_TYPED_ADVRTR(area->lsdb, type, ospf6->router_id, lsa)) {
+               struct ospf6_inter_prefix_lsa *prefix_lsa;
+               struct prefix prefix;
+
+               prefix_lsa =
+                       (struct ospf6_inter_prefix_lsa *)OSPF6_LSA_HEADER_END(
+                               lsa->header);
+               prefix.family = AF_INET6;
+               prefix.prefixlen = prefix_lsa->prefix.prefix_length;
+               ospf6_prefix_in6_addr(&prefix.u.prefix6, prefix_lsa,
+                                     &prefix_lsa->prefix);
+               if (prefix_same(p, &prefix))
+                       return lsa;
+       }
+
+       return NULL;
+}
+
 struct ospf6_lsa *ospf6_lsdb_lookup_next(uint16_t type, uint32_t id,
                                         uint32_t adv_router,
                                         struct ospf6_lsdb *lsdb)
@@ -369,7 +396,7 @@ int ospf6_lsdb_maxage_remover(struct ospf6_lsdb *lsdb)
                        ospf6_lsa_checksum(lsa->header);
 
                        THREAD_OFF(lsa->refresh);
-                       thread_execute(master, ospf6_lsa_refresh, lsa, 0);
+                       event_execute(master, ospf6_lsa_refresh, lsa, 0);
                } else {
                        zlog_debug("calling ospf6_lsdb_remove %s", lsa->name);
                        ospf6_lsdb_remove(lsa, lsdb);