]> git.proxmox.com Git - mirror_frr.git/blobdiff - ospfd/ospf_spf.c
Merge pull request #12837 from donaldsharp/unlikely_routemap
[mirror_frr.git] / ospfd / ospf_spf.c
index 7c1f9f17ac3c994a3508cb23a12b2e815297927e..274d5bc9af7b74b67c340bc8d36e80ba12c3b4ce 100644 (file)
@@ -6,7 +6,7 @@
 #include <zebra.h>
 
 #include "monotime.h"
-#include "thread.h"
+#include "frrevent.h"
 #include "memory.h"
 #include "hash.h"
 #include "linklist.h"
@@ -1764,7 +1764,8 @@ void ospf_spf_calculate(struct ospf_area *area, struct ospf_lsa *root_lsa,
                if (v->type != OSPF_VERTEX_ROUTER)
                        ospf_intra_add_transit(new_table, v, area);
                else {
-                       ospf_intra_add_router(new_rtrs, v, area, false);
+                       if (new_rtrs)
+                               ospf_intra_add_router(new_rtrs, v, area, false);
                        if (all_rtrs)
                                ospf_intra_add_router(all_rtrs, v, area, true);
                }
@@ -1841,9 +1842,9 @@ void ospf_spf_calculate_areas(struct ospf *ospf, struct route_table *new_table,
 }
 
 /* Worker for SPF calculation scheduler. */
-static void ospf_spf_calculate_schedule_worker(struct thread *thread)
+static void ospf_spf_calculate_schedule_worker(struct event *thread)
 {
-       struct ospf *ospf = THREAD_ARG(thread);
+       struct ospf *ospf = EVENT_ARG(thread);
        struct route_table *new_table, *new_rtrs;
        struct route_table *all_rtrs = NULL;
        struct timeval start_time, spf_start_time;
@@ -2043,8 +2044,8 @@ void ospf_spf_calculate_schedule(struct ospf *ospf, ospf_spf_reason_t reason)
                zlog_debug("SPF: calculation timer delay = %ld msec", delay);
 
        ospf->t_spf_calc = NULL;
-       thread_add_timer_msec(master, ospf_spf_calculate_schedule_worker, ospf,
-                             delay, &ospf->t_spf_calc);
+       event_add_timer_msec(master, ospf_spf_calculate_schedule_worker, ospf,
+                            delay, &ospf->t_spf_calc);
 }
 
 /* Restart OSPF SPF algorithm*/