summaryrefslogtreecommitdiff
path: root/ospfd
diff options
context:
space:
mode:
Diffstat (limited to 'ospfd')
-rw-r--r--ospfd/ospf_abr.c1
-rw-r--r--ospfd/ospf_asbr.c22
-rw-r--r--ospfd/ospf_asbr.h3
-rw-r--r--ospfd/ospf_dump.c17
-rw-r--r--ospfd/ospf_snmp.c2
-rw-r--r--ospfd/ospf_vty.c1
-rw-r--r--ospfd/ospfd.c1
-rw-r--r--ospfd/ospfd.h2
-rw-r--r--ospfd/subdir.am2
9 files changed, 36 insertions, 15 deletions
diff --git a/ospfd/ospf_abr.c b/ospfd/ospf_abr.c
index b5c97eda3c..a6027ee9d1 100644
--- a/ospfd/ospf_abr.c
+++ b/ospfd/ospf_abr.c
@@ -1818,7 +1818,6 @@ static int ospf_abr_task_timer(struct thread *thread)
ospf_abr_task(ospf);
ospf_abr_nssa_task(ospf); /* if nssa-abr, then scan Type-7 LSDB */
- ospf_asbr_nssa_redist_task(ospf);
return 0;
}
diff --git a/ospfd/ospf_asbr.c b/ospfd/ospf_asbr.c
index 0b4e5d7762..6d80725ae6 100644
--- a/ospfd/ospf_asbr.c
+++ b/ospfd/ospf_asbr.c
@@ -277,10 +277,16 @@ void ospf_asbr_status_update(struct ospf *ospf, uint8_t status)
/* If there's redistribution configured, we need to refresh external
* LSAs in order to install Type-7 and flood to all NSSA Areas
*/
-void ospf_asbr_nssa_redist_task(struct ospf *ospf)
+static int ospf_asbr_nssa_redist_update_timer(struct thread *thread)
{
+ struct ospf *ospf = THREAD_ARG(thread);
int type;
+ ospf->t_asbr_nssa_redist_update = NULL;
+
+ if (IS_DEBUG_OSPF_EVENT)
+ zlog_debug("Running ASBR NSSA redistribution update on timer");
+
for (type = 0; type < ZEBRA_ROUTE_MAX; type++) {
struct list *red_list;
struct listnode *node;
@@ -293,10 +299,22 @@ void ospf_asbr_nssa_redist_task(struct ospf *ospf)
for (ALL_LIST_ELEMENTS_RO(red_list, node, red))
ospf_external_lsa_refresh_type(ospf, type,
red->instance,
- LSA_REFRESH_IF_CHANGED);
+ LSA_REFRESH_FORCE);
}
ospf_external_lsa_refresh_default(ospf);
+
+ return 0;
+}
+
+void ospf_schedule_asbr_nssa_redist_update(struct ospf *ospf)
+{
+ if (IS_DEBUG_OSPF_EVENT)
+ zlog_debug("Scheduling ASBR NSSA redistribution update");
+
+ thread_add_timer(master, ospf_asbr_nssa_redist_update_timer, ospf,
+ OSPF_ASBR_NSSA_REDIST_UPDATE_DELAY,
+ &ospf->t_asbr_nssa_redist_update);
}
void ospf_redistribute_withdraw(struct ospf *ospf, uint8_t type,
diff --git a/ospfd/ospf_asbr.h b/ospfd/ospf_asbr.h
index 7759d45455..d3e50903ef 100644
--- a/ospfd/ospf_asbr.h
+++ b/ospfd/ospf_asbr.h
@@ -104,6 +104,7 @@ struct ospf_external_aggr_rt {
};
#define OSPF_ASBR_CHECK_DELAY 30
+#define OSPF_ASBR_NSSA_REDIST_UPDATE_DELAY 9
extern void ospf_external_route_remove(struct ospf *, struct prefix_ipv4 *);
extern struct external_info *ospf_external_info_new(uint8_t, unsigned short);
@@ -121,7 +122,7 @@ extern struct external_info *ospf_external_info_lookup(struct ospf *, uint8_t,
unsigned short,
struct prefix_ipv4 *);
extern void ospf_asbr_status_update(struct ospf *, uint8_t);
-extern void ospf_asbr_nssa_redist_task(struct ospf *ospf);
+extern void ospf_schedule_asbr_nssa_redist_update(struct ospf *ospf);
extern void ospf_redistribute_withdraw(struct ospf *, uint8_t, unsigned short);
extern void ospf_asbr_check(void);
diff --git a/ospfd/ospf_dump.c b/ospfd/ospf_dump.c
index 2442f2e781..8f31f90346 100644
--- a/ospfd/ospf_dump.c
+++ b/ospfd/ospf_dump.c
@@ -169,8 +169,7 @@ const char *ospf_timeval_dump(struct timeval *t, char *buf, size_t size)
/* Making formatted timer strings. */
#define MINUTE_IN_SECONDS 60
#define HOUR_IN_SECONDS (60*MINUTE_IN_SECONDS)
-#define DAY_IN_SECONDS (24*HOUR_IN_SECONDS)
-#define WEEK_IN_SECONDS (7*DAY_IN_SECONDS)
+
unsigned long w, d, h, m, ms, us;
if (!t)
@@ -191,14 +190,14 @@ const char *ospf_timeval_dump(struct timeval *t, char *buf, size_t size)
ms %= 1000;
}
- if (t->tv_sec > WEEK_IN_SECONDS) {
- w = t->tv_sec / WEEK_IN_SECONDS;
- t->tv_sec -= w * WEEK_IN_SECONDS;
+ if (t->tv_sec > ONE_WEEK_SECOND) {
+ w = t->tv_sec / ONE_WEEK_SECOND;
+ t->tv_sec -= w * ONE_WEEK_SECOND;
}
- if (t->tv_sec > DAY_IN_SECONDS) {
- d = t->tv_sec / DAY_IN_SECONDS;
- t->tv_sec -= d * DAY_IN_SECONDS;
+ if (t->tv_sec > ONE_DAY_SECOND) {
+ d = t->tv_sec / ONE_DAY_SECOND;
+ t->tv_sec -= d * ONE_DAY_SECOND;
}
if (t->tv_sec >= HOUR_IN_SECONDS) {
@@ -221,7 +220,7 @@ const char *ospf_timeval_dump(struct timeval *t, char *buf, size_t size)
snprintf(buf, size, "%luh%02lum%02lds", h, m, (long)t->tv_sec);
else if (m)
snprintf(buf, size, "%lum%02lds", m, (long)t->tv_sec);
- else if (ms)
+ else if (t->tv_sec > 0 || ms > 0)
snprintf(buf, size, "%ld.%03lus", (long)t->tv_sec, ms);
else
snprintf(buf, size, "%ld usecs", (long)t->tv_usec);
diff --git a/ospfd/ospf_snmp.c b/ospfd/ospf_snmp.c
index 43b998ac5b..432f95f9dd 100644
--- a/ospfd/ospf_snmp.c
+++ b/ospfd/ospf_snmp.c
@@ -34,7 +34,7 @@
#include "memory.h"
#include "smux.h"
#include "libfrr.h"
-#include "version.h"
+#include "lib/version.h"
#include "ospfd/ospfd.h"
#include "ospfd/ospf_interface.h"
diff --git a/ospfd/ospf_vty.c b/ospfd/ospf_vty.c
index be446705ea..69a3e45878 100644
--- a/ospfd/ospf_vty.c
+++ b/ospfd/ospf_vty.c
@@ -1546,6 +1546,7 @@ static int ospf_area_nssa_cmd_handler(struct vty *vty, int argc,
/* Flush the external LSA for the specified area */
ospf_flush_lsa_from_area(ospf, area_id, OSPF_AS_EXTERNAL_LSA);
ospf_schedule_abr_task(ospf);
+ ospf_schedule_asbr_nssa_redist_update(ospf);
return CMD_SUCCESS;
}
diff --git a/ospfd/ospfd.c b/ospfd/ospfd.c
index 9949a78336..faec868b2a 100644
--- a/ospfd/ospfd.c
+++ b/ospfd/ospfd.c
@@ -791,6 +791,7 @@ static void ospf_finish_final(struct ospf *ospf)
OSPF_TIMER_OFF(ospf->t_maxage_walker);
OSPF_TIMER_OFF(ospf->t_abr_task);
OSPF_TIMER_OFF(ospf->t_asbr_check);
+ OSPF_TIMER_OFF(ospf->t_asbr_nssa_redist_update);
OSPF_TIMER_OFF(ospf->t_distribute_update);
OSPF_TIMER_OFF(ospf->t_lsa_refresher);
OSPF_TIMER_OFF(ospf->t_opaque_lsa_self);
diff --git a/ospfd/ospfd.h b/ospfd/ospfd.h
index 2093eb2e42..318400e968 100644
--- a/ospfd/ospfd.h
+++ b/ospfd/ospfd.h
@@ -242,6 +242,8 @@ struct ospf {
/* Threads. */
struct thread *t_abr_task; /* ABR task timer. */
struct thread *t_asbr_check; /* ASBR check timer. */
+ struct thread *t_asbr_nssa_redist_update; /* ASBR NSSA redistribution
+ update timer. */
struct thread *t_distribute_update; /* Distirbute list update timer. */
struct thread *t_spf_calc; /* SPF calculation timer. */
struct thread *t_ase_calc; /* ASE calculation timer. */
diff --git a/ospfd/subdir.am b/ospfd/subdir.am
index f592a9eec8..574e0e3bdf 100644
--- a/ospfd/subdir.am
+++ b/ospfd/subdir.am
@@ -115,7 +115,7 @@ ospfd_ospfd_LDADD = ospfd/libfrrospf.a lib/libfrr.la $(LIBCAP) $(LIBM)
ospfd_ospfd_SOURCES = ospfd/ospf_main.c
ospfd_ospfd_snmp_la_SOURCES = ospfd/ospf_snmp.c
-ospfd_ospfd_snmp_la_CFLAGS = $(WERROR) $(SNMP_CFLAGS) -std=gnu11
+ospfd_ospfd_snmp_la_CFLAGS = $(AM_CFLAGS) $(SNMP_CFLAGS) -std=gnu11
ospfd_ospfd_snmp_la_LDFLAGS = -avoid-version -module -shared -export-dynamic
ospfd_ospfd_snmp_la_LIBADD = lib/libfrrsnmp.la