From a9509290da36d6222c89d7770290571c5f4092ca Mon Sep 17 00:00:00 2001 From: Dimitri Staessens Date: Sun, 27 Feb 2022 10:53:13 +0100 Subject: lib: Fix underflow in keepalive timer If the keepalive would underflow if set to 1-3 ms. Signed-off-by: Dimitri Staessens Signed-off-by: Sander Vrijders --- src/lib/dev.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/lib') diff --git a/src/lib/dev.c b/src/lib/dev.c index 31941afd..c5667f06 100644 --- a/src/lib/dev.c +++ b/src/lib/dev.c @@ -1084,7 +1084,7 @@ static int flow_keepalive(int fd) return -EFLOWPEER; } - if (ts_diff_ns(&s_act, &now) > (timeo >> 2) * MILLION) + if (ts_diff_ns(&s_act, &now) > (timeo * MILLION) >> 2) flow_send_keepalive(fd); return 0; -- cgit v1.2.3