summaryrefslogtreecommitdiff
path: root/zebra/interface.c
diff options
context:
space:
mode:
authorDonald Sharp <sharpd@nvidia.com>2022-01-19 14:56:25 -0500
committerDonald Sharp <sharpd@nvidia.com>2022-01-20 11:58:48 -0500
commite8b3a2f74b707529c70908c6afc97a486588ef30 (patch)
tree33d0f5d910db7949be2c6d911e7a17cb225fafc6 /zebra/interface.c
parentab01a00176db60080047731ab548136e773b6c51 (diff)
lib, zebra: Add ability to tell thread system to ignore late timers
Add a thread_ignore_late_timer(struct thread *thread) function that allows thread.c to ignore when timers are late to the party. Signed-off-by: Donald Sharp <sharpd@nvidia.com>
Diffstat (limited to 'zebra/interface.c')
-rw-r--r--zebra/interface.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/zebra/interface.c b/zebra/interface.c
index 8b5dbabb92..534953d903 100644
--- a/zebra/interface.c
+++ b/zebra/interface.c
@@ -91,9 +91,12 @@ static int if_zebra_speed_update(struct thread *thread)
changed = true;
}
- if (changed || new_speed == UINT32_MAX)
+ if (changed || new_speed == UINT32_MAX) {
thread_add_timer(zrouter.master, if_zebra_speed_update, ifp, 5,
&zif->speed_update);
+ thread_ignore_late_timer(zif->speed_update);
+ }
+
return 1;
}
@@ -187,6 +190,8 @@ static int if_zebra_new_hook(struct interface *ifp)
*/
thread_add_timer(zrouter.master, if_zebra_speed_update, ifp, 15,
&zebra_if->speed_update);
+ thread_ignore_late_timer(zebra_if->speed_update);
+
return 0;
}
@@ -1074,6 +1079,7 @@ void if_up(struct interface *ifp)
thread_add_timer(zrouter.master, if_zebra_speed_update, ifp, 0,
&zif->speed_update);
+ thread_ignore_late_timer(zif->speed_update);
}
/* Interface goes down. We have to manage different behavior of based