From f4b5965a0f8a4595276194c0e2c5d057cfae3549 Mon Sep 17 00:00:00 2001 From: sunsuwan Date: Sat, 27 May 2023 14:56:06 +0800 Subject: [PATCH] fix clockdiff host is down bug --- ...iff-Set-ppoll-timeout-minimum-to-1ms.patch | 27 +++++++++++++++++++ iputils.spec | 10 ++++++- 2 files changed, 36 insertions(+), 1 deletion(-) create mode 100644 backport-clockdiff-Set-ppoll-timeout-minimum-to-1ms.patch diff --git a/backport-clockdiff-Set-ppoll-timeout-minimum-to-1ms.patch b/backport-clockdiff-Set-ppoll-timeout-minimum-to-1ms.patch new file mode 100644 index 0000000..92cfb46 --- /dev/null +++ b/backport-clockdiff-Set-ppoll-timeout-minimum-to-1ms.patch @@ -0,0 +1,27 @@ +From 471942dee341e5aae2a277ecd85c05e671752880 Mon Sep 17 00:00:00 2001 +From: caibingcheng +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 +Reviewed-by: Noah Meyerhans +Signed-off-by: caibingcheng +--- + 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; diff --git a/iputils.spec b/iputils.spec index 08c5fd5..991f1e7 100644 --- a/iputils.spec +++ b/iputils.spec @@ -1,6 +1,6 @@ Name: iputils Version: 20221126 -Release: 1 +Release: 2 Summary: Network monitoring tools including ping License: BSD and GPLv2+ URL: https://github.com/iputils/iputils @@ -16,6 +16,8 @@ Patch0002: revert-process-interrupts-in-ping-_receive_error_msg.patch Patch0010: arping-Fix-exit-code-on-w-option.patch +Patch6000: backport-clockdiff-Set-ppoll-timeout-minimum-to-1ms.patch + BuildRequires: gcc meson libidn2-devel openssl-devel libcap-devel libxslt BuildRequires: docbook5-style-xsl systemd iproute glibc-kernheaders gettext %{?systemd_ordering} @@ -86,6 +88,12 @@ install -cp ifenslave.8 ${RPM_BUILD_ROOT}%{_mandir}/man8/ %{_mandir}/man8/*.8.gz %changelog +* Sat May 27 2023 zhongxuan - 20221126-2 +- Type:bugfix +- ID:NA +- SUG:NA +- DESC: fix clockdiff host is down bug + * Wed Mar 08 2023 zhongxuan - 20221126-1 - Type:requirements - ID:NA -- Gitee