修复使用clockdiff命令是包对端down问题
Signed-off-by: liugang <liuganga@uniontech.com>
This commit is contained in:
parent
72913d9f93
commit
b9c09c1ee2
42
backport-fix-clockdiff-is-server-down.patch
Normal file
42
backport-fix-clockdiff-is-server-down.patch
Normal file
@ -0,0 +1,42 @@
|
||||
From 34b9bc30b24ea0557772c7c9153ab5065db762ea Mon Sep 17 00:00:00 2001
|
||||
From: root <root@localhost.localdomain>
|
||||
Date: Mon, 27 Dec 2021 20:27:43 +0800
|
||||
Subject: [PATCH] fix clockdiff is server down
|
||||
|
||||
---
|
||||
clockdiff.c | 5 ++++-
|
||||
1 file changed, 4 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/clockdiff.c b/clockdiff.c
|
||||
index 7836658..7fbb9dc 100644
|
||||
--- a/clockdiff.c
|
||||
+++ b/clockdiff.c
|
||||
@@ -322,7 +322,7 @@ static int measure_inner_loop(struct run_state *ctl, struct measure_vars *mv)
|
||||
if (diff < RANGE) {
|
||||
mv->min1 = delta1;
|
||||
mv->min2 = delta2;
|
||||
- return BREAK;
|
||||
+ return GOOD;
|
||||
}
|
||||
}
|
||||
return CONTINUE;
|
||||
@@ -416,6 +416,8 @@ static int measure(struct run_state *ctl)
|
||||
case BREAK:
|
||||
escape = 1;
|
||||
break;
|
||||
+ case GOOD:
|
||||
+ goto good_exit;
|
||||
case CONTINUE:
|
||||
continue;
|
||||
default:
|
||||
@@ -423,6 +425,7 @@ static int measure(struct run_state *ctl)
|
||||
}
|
||||
}
|
||||
}
|
||||
+good_exit:
|
||||
ctl->measure_delta = (mv.min1 - mv.min2) / 2 + PROCESSING_TIME;
|
||||
return GOOD;
|
||||
}
|
||||
--
|
||||
2.27.0
|
||||
|
||||
10
iputils.spec
10
iputils.spec
@ -1,6 +1,6 @@
|
||||
Name: iputils
|
||||
Version: 20190709
|
||||
Release: 7
|
||||
Release: 8
|
||||
Summary: Network monitoring tools including ping
|
||||
License: BSD and GPLv2+
|
||||
URL: https://github.com/iputils/iputils
|
||||
@ -22,6 +22,7 @@ Patch6003: bugfix-rdisc-remove-PrivateUsers=yes-from-systemd-service-file.
|
||||
Patch9000: bugfix-fix-ping-dead-loop.patch
|
||||
Patch9001: bugfix-arping-w-does-not-take-effect.patch
|
||||
Patch9002: bugfix-fix-update-problem.patch
|
||||
Patch9003: backport-fix-clockdiff-is-server-down.patch
|
||||
|
||||
BuildRequires: gcc meson libidn2-devel openssl-devel libcap-devel libxslt
|
||||
BuildRequires: docbook5-style-xsl systemd glibc-kernheaders gettext
|
||||
@ -51,6 +52,7 @@ cp %{SOURCE4} %{SOURCE5} .
|
||||
%patch9000 -p1
|
||||
%patch9001 -p1
|
||||
%patch9002 -p1
|
||||
%patch9003 -p1
|
||||
|
||||
%build
|
||||
export CFLAGS="-fpie"
|
||||
@ -105,6 +107,12 @@ install -cp ifenslave.8 ${RPM_BUILD_ROOT}%{_mandir}/man8/
|
||||
%{_mandir}/man8/*.8.gz
|
||||
|
||||
%changelog
|
||||
* Mon Dec 27 2021 liugang <liuganga@uniontech.com> - 20190709-8
|
||||
- Type:bugfix
|
||||
- Id:NA
|
||||
- SUG:NA
|
||||
- DESC:fix clockdiff is server down
|
||||
|
||||
* Mon May 17 2021 gaihuiying <gaihuiying1@huawei.com> - 20190709-7
|
||||
- Type:bugfix
|
||||
- Id:NA
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user