If the keepalive would underflow if set to 1-3 ms.
Signed-off-by: Dimitri Staessens <dimitri@ouroboros.rocks>
---
src/lib/dev.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
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;
--
2.35.1