aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFlorin Coras <fcoras@cisco.com>2020-05-14 00:30:18 +0000
committerDamjan Marion <dmarion@me.com>2020-05-14 18:09:05 +0000
commit17b5c3d6ab83a597e7c79613041f2fd7470825bd (patch)
treef8c2052de0f6159bedda296ad73ffd895d6aaf4d
parent1ce60463a8f1ed0e65af77662e4ecf9d52d36c47 (diff)
tcp: fix bogus time update due to missing cast
Type: fix Seems clang needs explicit casting to u64 of u64 and f64 multiplication before truncating to u32 Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: Ib0d7a33d4c5e68577e401e854fc3e55e0723da93
-rw-r--r--src/vnet/tcp/tcp_inlines.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/vnet/tcp/tcp_inlines.h b/src/vnet/tcp/tcp_inlines.h
index cb18860b1b1..c4b155aa499 100644
--- a/src/vnet/tcp/tcp_inlines.h
+++ b/src/vnet/tcp/tcp_inlines.h
@@ -218,7 +218,8 @@ tcp_time_now_us (u32 thread_index)
always_inline u32
tcp_set_time_now (tcp_worker_ctx_t * wrk)
{
- wrk->time_now = clib_cpu_time_now () * tcp_main.tstamp_ticks_per_clock;
+ tcp_main_t *tm = &tcp_main;
+ wrk->time_now = (u64) (clib_cpu_time_now () * tm->tstamp_ticks_per_clock);
return wrk->time_now;
}