1 Star 0 Fork 29

cao/iputils

forked from src-openEuler/iputils 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
backport-clockdiff-Set-ppoll-timeout-minimum-to-1ms.patch 991 Bytes
一键复制 编辑 原始数据 按行查看 历史
zhongxuan2 提交于 2024-04-01 06:29 . sync 22.03-sp1 patches
From 471942dee341e5aae2a277ecd85c05e671752880 Mon Sep 17 00:00:00 2001
From: caibingcheng <jack_cbc@163.com>
Date: Mon, 24 Apr 2023 20:45:28 +0800
Subject: [PATCH] clockdiff: Set ppoll timeout minimum to 1ms
Fixes: https://github.com/iputils/iputils/issues/326
Closes: https://github.com/iputils/iputils/pull/459
Reviewed-by: Petr Vorel <pvorel@suse.cz>
Reviewed-by: Noah Meyerhans <noahm@debian.org>
Signed-off-by: caibingcheng <jack_cbc@163.com>
---
clockdiff.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/clockdiff.c b/clockdiff.c
index 5e639ab7..ccb5b5b3 100644
--- a/clockdiff.c
+++ b/clockdiff.c
@@ -210,7 +210,7 @@ static int measure_inner_loop(struct run_state *ctl, struct measure_vars *mv)
struct pollfd p = { .fd = ctl->sock_raw, .events = POLLIN | POLLHUP };
{
- long tmo = ctl->rtt + ctl->rtt_sigma;
+ long tmo = MAX(ctl->rtt + ctl->rtt_sigma, 1);
mv->tout.tv_sec = tmo / 1000;
mv->tout.tv_nsec = (tmo - (tmo / 1000) * 1000) * 1000000;
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/korolevc/iputils.git
git@gitee.com:korolevc/iputils.git
korolevc
iputils
iputils
master

搜索帮助