From 0f09b77778644577545235156a2ea2798ec9ee6c Mon Sep 17 00:00:00 2001 From: Andrew Li Date: Sun, 18 Jun 2017 12:11:57 -0700 Subject: flowprobe: Fixed assert error with less than 1 second passive timer When passive timer has less than 1 second left, it'll be forcifully changed to 0 when converting from f64 to u64. As a result the assertion will fail at the beginning of the passive timer start fuction. This commit fixed this bug by adding a check of the delta. Change-Id: I899b6e0ab4967dcecc821daf7e812dbbc90969ce Signed-off-by: Andrew Li --- src/plugins/flowprobe/node.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/plugins/flowprobe/node.c') diff --git a/src/plugins/flowprobe/node.c b/src/plugins/flowprobe/node.c index 604a0a0e15d..c4610a77fa4 100644 --- a/src/plugins/flowprobe/node.c +++ b/src/plugins/flowprobe/node.c @@ -971,9 +971,9 @@ flowprobe_walker_process (vlib_main_t * vm, * entry. Otherwise restart timer with what's left * Premature passive timer by more than 10% */ - if ((now - e->last_updated) < (fm->passive_timer * 0.9)) + if ((now - e->last_updated) < (u64) (fm->passive_timer * 0.9)) { - f64 delta = fm->passive_timer - (now - e->last_updated); + u64 delta = fm->passive_timer - (now - e->last_updated); e->passive_timer_handle = tw_timer_start_2t_1w_2048sl (fm->timers_per_worker[cpu_index], *i, 0, delta); } -- cgit 1.2.3-korg