From b5898d2f77a0451c506b10a3a4885e974ef418a1 Mon Sep 17 00:00:00 2001 From: Florin Coras Date: Thu, 14 May 2020 00:30:18 +0000 Subject: tcp: fix bogus time update due to missing cast Type: fix Ticket: VPP-1874 Seems clang needs explicit casting to u64 of u64 and f64 multiplication before truncating to u32 Signed-off-by: Florin Coras Change-Id: Ib0d7a33d4c5e68577e401e854fc3e55e0723da93 (cherry picked from commit 17b5c3d6ab83a597e7c79613041f2fd7470825bd) --- src/vnet/tcp/tcp_inlines.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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; } -- cgit 1.2.3-korg