sync 22.03-sp1 patches
This commit is contained in:
parent
42afa1e826
commit
3033158ddc
24
arping-Fix-exit-code-on-w-option.patch
Normal file
24
arping-Fix-exit-code-on-w-option.patch
Normal file
@ -0,0 +1,24 @@
|
|||||||
|
From 4c2dd9f020df2749bdff294756b04aafa99ad624 Mon Sep 17 00:00:00 2001
|
||||||
|
From: eaglegai <eaglegai@163.com>
|
||||||
|
Date: Fri, 18 Mar 2022 19:32:21 +0800
|
||||||
|
Subject: [PATCH] arping: Fix exit code on -w option when count * interval >
|
||||||
|
timeout
|
||||||
|
|
||||||
|
Signed-off-by: eaglegai <eaglegai@163.com>
|
||||||
|
---
|
||||||
|
arping.c | 2 +-
|
||||||
|
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||||
|
|
||||||
|
diff --git a/arping.c b/arping.c
|
||||||
|
index 20b0554b..fe79d2f8 100644
|
||||||
|
--- a/arping.c
|
||||||
|
+++ b/arping.c
|
||||||
|
@@ -850,7 +850,7 @@ static int event_loop(struct run_state *ctl)
|
||||||
|
else if (ctl->dad && ctl->quit_on_reply)
|
||||||
|
/* Duplicate address detection mode return value */
|
||||||
|
rc |= !(ctl->brd_sent != ctl->received);
|
||||||
|
- else if (ctl->timeout && !(ctl->count > 0))
|
||||||
|
+ else if (ctl->timeout && (!(ctl->count > 0) || (ctl->interval > ctl->timeout / ctl->count)))
|
||||||
|
rc |= !(ctl->received > 0);
|
||||||
|
else
|
||||||
|
rc |= (ctl->sent != ctl->received);
|
||||||
27
backport-clockdiff-Set-ppoll-timeout-minimum-to-1ms.patch
Normal file
27
backport-clockdiff-Set-ppoll-timeout-minimum-to-1ms.patch
Normal file
@ -0,0 +1,27 @@
|
|||||||
|
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;
|
||||||
27
backport-ping-fix-overflow-on-negative.patch
Normal file
27
backport-ping-fix-overflow-on-negative.patch
Normal file
@ -0,0 +1,27 @@
|
|||||||
|
From 2a63b94313352ed62f47adbc1a0d33bfea7ca188 Mon Sep 17 00:00:00 2001
|
||||||
|
From: Petr Vorel <pvorel@suse.cz>
|
||||||
|
Date: Wed, 17 May 2023 00:57:24 +0200
|
||||||
|
Subject: [PATCH] ping: Fix overflow on negative -i
|
||||||
|
|
||||||
|
Restore back check for -i <= 0.
|
||||||
|
|
||||||
|
Fixes: 918e824 ("ping: add support for sub-second timeouts")
|
||||||
|
Closes: https://github.com/iputils/iputils/issues/465
|
||||||
|
Signed-off-by: Petr Vorel <pvorel@suse.cz>
|
||||||
|
---
|
||||||
|
ping/ping.c | 2 +-
|
||||||
|
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||||
|
|
||||||
|
diff --git a/ping/ping.c b/ping/ping.c
|
||||||
|
index 8f442037..27c72cad 100644
|
||||||
|
--- a/ping/ping.c
|
||||||
|
+++ b/ping/ping.c
|
||||||
|
@@ -436,7 +436,7 @@ main(int argc, char **argv)
|
||||||
|
double optval;
|
||||||
|
|
||||||
|
optval = ping_strtod(optarg, _("bad timing interval"));
|
||||||
|
- if (isgreater(optval, (double)INT_MAX / 1000))
|
||||||
|
+ if (islessequal(optval, 0) || isgreater(optval, (double)INT_MAX / 1000))
|
||||||
|
error(2, 0, _("bad timing interval: %s"), optarg);
|
||||||
|
rts.interval = (int)(optval * 1000);
|
||||||
|
rts.opt_interval = 1;
|
||||||
70
backport-tracepath-Restore-the-MTU-probing-behavior.patch
Normal file
70
backport-tracepath-Restore-the-MTU-probing-behavior.patch
Normal file
@ -0,0 +1,70 @@
|
|||||||
|
From d2311b4517beebda22c76f82a120f7b1f765a79d Mon Sep 17 00:00:00 2001
|
||||||
|
From: csalinezh <csalinezh@gmail.com>
|
||||||
|
Date: Thu, 5 Jan 2023 22:38:31 +0200
|
||||||
|
Subject: [PATCH] tracepath: restore the MTU probing behaviour since release
|
||||||
|
20071127
|
||||||
|
|
||||||
|
Since 81d0f03 (tracepath: fix IP{V6,}_PMTUDISC_DO values), tracepath
|
||||||
|
shows the PMTU for a target only at the first hop but not the hop where
|
||||||
|
MTU is reduced, if that data has been cached in kernel FIB by previous
|
||||||
|
probing attempts.
|
||||||
|
|
||||||
|
IP_PMTUDISC_PROBE instructs the kernel to set the Don't Fragment flag
|
||||||
|
while bypassing PMTU checks. Usage of IP_PMTUDISC_PROBE in tracepath was
|
||||||
|
introduced in 37bd60c and mentioned in the release note of 20071127
|
||||||
|
(1d83610) as a feature.
|
||||||
|
|
||||||
|
As previously identified in 81d0f03 (appeared in release 20190709), the
|
||||||
|
definition of these options became incorrect during a copy refactoring in
|
||||||
|
d3028f1 (in release 20100418). The value for IP_PMTUDISC_PROBE continued
|
||||||
|
to be used until 81d0f03 when the correct definition of IP_PMTUDISC_DO was
|
||||||
|
adopted, thus causing a regression.
|
||||||
|
|
||||||
|
This commit resotres the previous behaviour by adopting IP_PMTUDISC_PROBE.
|
||||||
|
|
||||||
|
Fixes: d3028f1, 81d0f03
|
||||||
|
Signed-off-by: Charles Zhang <csalinezh@gmail.com>
|
||||||
|
---
|
||||||
|
iputils_common.h | 6 ++++++
|
||||||
|
tracepath.c | 4 ++--
|
||||||
|
2 files changed, 8 insertions(+), 2 deletions(-)
|
||||||
|
|
||||||
|
diff --git a/iputils_common.h b/iputils_common.h
|
||||||
|
index 67b495ef..49e790d8 100644
|
||||||
|
--- a/iputils_common.h
|
||||||
|
+++ b/iputils_common.h
|
||||||
|
@@ -55,6 +55,12 @@
|
||||||
|
#ifndef IPV6_PMTUDISC_DO
|
||||||
|
# define IPV6_PMTUDISC_DO 2
|
||||||
|
#endif
|
||||||
|
+#ifndef IP_PMTUDISC_PROBE
|
||||||
|
+# define IP_PMTUDISC_PROBE 3
|
||||||
|
+#endif
|
||||||
|
+#ifndef IPV6_PMTUDISC_PROBE
|
||||||
|
+# define IPV6_PMTUDISC_PROBE 3
|
||||||
|
+#endif
|
||||||
|
|
||||||
|
#ifdef HAVE_ERROR_H
|
||||||
|
# include <error.h>
|
||||||
|
diff --git a/tracepath.c b/tracepath.c
|
||||||
|
index 4d2a9acf..ebb7f72f 100644
|
||||||
|
--- a/tracepath.c
|
||||||
|
+++ b/tracepath.c
|
||||||
|
@@ -532,7 +532,7 @@ int main(int argc, char **argv)
|
||||||
|
if (ctl.mtu <= ctl.overhead)
|
||||||
|
goto pktlen_error;
|
||||||
|
|
||||||
|
- on = IPV6_PMTUDISC_DO;
|
||||||
|
+ on = IPV6_PMTUDISC_PROBE;
|
||||||
|
if (setsockopt(ctl.socket_fd, SOL_IPV6, IPV6_MTU_DISCOVER, &on, sizeof(on)) &&
|
||||||
|
(on = IPV6_PMTUDISC_DO, setsockopt(ctl.socket_fd, SOL_IPV6,
|
||||||
|
IPV6_MTU_DISCOVER, &on, sizeof(on))))
|
||||||
|
@@ -557,7 +557,7 @@ int main(int argc, char **argv)
|
||||||
|
if (ctl.mtu <= ctl.overhead)
|
||||||
|
goto pktlen_error;
|
||||||
|
|
||||||
|
- on = IP_PMTUDISC_DO;
|
||||||
|
+ on = IP_PMTUDISC_PROBE;
|
||||||
|
if (setsockopt(ctl.socket_fd, SOL_IP, IP_MTU_DISCOVER, &on, sizeof(on)))
|
||||||
|
error(1, errno, "IP_MTU_DISCOVER");
|
||||||
|
on = 1;
|
||||||
19
iputils.spec
19
iputils.spec
@ -1,6 +1,6 @@
|
|||||||
Name: iputils
|
Name: iputils
|
||||||
Version: 20221126
|
Version: 20221126
|
||||||
Release: 3
|
Release: 4
|
||||||
Summary: Network monitoring tools including ping
|
Summary: Network monitoring tools including ping
|
||||||
License: BSD and GPLv2+
|
License: BSD and GPLv2+
|
||||||
URL: https://github.com/iputils/iputils
|
URL: https://github.com/iputils/iputils
|
||||||
@ -12,6 +12,13 @@ Source3: https://www.gnu.org/licenses/old-licenses/gpl-2.0.txt
|
|||||||
|
|
||||||
Patch0000: iputils-ifenslave.patch
|
Patch0000: iputils-ifenslave.patch
|
||||||
Patch0001: iputils-ifenslave-CWE-170.patch
|
Patch0001: iputils-ifenslave-CWE-170.patch
|
||||||
|
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
|
||||||
|
Patch6001: backport-ping-fix-overflow-on-negative.patch
|
||||||
|
Patch6002: backport-tracepath-Restore-the-MTU-probing-behavior.patch
|
||||||
|
|
||||||
BuildRequires: gcc meson libidn2-devel openssl-devel libcap-devel libxslt
|
BuildRequires: gcc meson libidn2-devel openssl-devel libcap-devel libxslt
|
||||||
BuildRequires: docbook5-style-xsl systemd iproute glibc-kernheaders gettext
|
BuildRequires: docbook5-style-xsl systemd iproute glibc-kernheaders gettext
|
||||||
@ -82,8 +89,14 @@ install -cp ifenslave.8 ${RPM_BUILD_ROOT}%{_mandir}/man8/
|
|||||||
%{_mandir}/man8/*.8.gz
|
%{_mandir}/man8/*.8.gz
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
* Thu Nov 16 2023 renyi <renyi43@huawei.com> - 20221126-3
|
* Mon Apr 1 2024 zhongxuan <zhongxuan2@huawei.com> - 20221126-4
|
||||||
- Type:enhencement
|
- Type:bugfix
|
||||||
|
- ID:NA
|
||||||
|
- SUG:NA
|
||||||
|
- DESC: backport two patches
|
||||||
|
|
||||||
|
* Thu Nov 16 2023 r30030392 <renyi43@huawei.com> - 20221126-3
|
||||||
|
- Type:NA
|
||||||
- CVE:NA
|
- CVE:NA
|
||||||
- SUG:NA
|
- SUG:NA
|
||||||
- DESC:support for building with clang
|
- DESC:support for building with clang
|
||||||
|
|||||||
46
revert-process-interrupts-in-ping-_receive_error_msg.patch
Normal file
46
revert-process-interrupts-in-ping-_receive_error_msg.patch
Normal file
@ -0,0 +1,46 @@
|
|||||||
|
From 6b94c384b8f5337fff2f3c3145d0239ff91618cd Mon Sep 17 00:00:00 2001
|
||||||
|
From: eaglegai <eaglegai@163.com>
|
||||||
|
Date: Sat, 5 Mar 2022 09:37:47 +0800
|
||||||
|
Subject: [PATCH] revert process interrupts in ping*_receive_error_msg
|
||||||
|
|
||||||
|
---
|
||||||
|
ping/ping.c | 5 +----
|
||||||
|
ping/ping6_common.c | 5 +----
|
||||||
|
2 files changed, 2 insertions(+), 8 deletions(-)
|
||||||
|
|
||||||
|
diff --git a/ping/ping.c b/ping/ping.c
|
||||||
|
index 6fcb44f..7ec4836 100644
|
||||||
|
--- a/ping/ping.c
|
||||||
|
+++ b/ping/ping.c
|
||||||
|
@@ -1314,11 +1314,8 @@ int ping4_receive_error_msg(struct ping_rts *rts, socket_st *sock)
|
||||||
|
msg.msg_controllen = sizeof(cbuf);
|
||||||
|
|
||||||
|
res = recvmsg(sock->fd, &msg, MSG_ERRQUEUE | MSG_DONTWAIT);
|
||||||
|
- if (res < 0) {
|
||||||
|
- if (errno == EAGAIN || errno == EINTR)
|
||||||
|
- local_errors++;
|
||||||
|
+ if (res < 0)
|
||||||
|
goto out;
|
||||||
|
- }
|
||||||
|
|
||||||
|
e = NULL;
|
||||||
|
for (cmsgh = CMSG_FIRSTHDR(&msg); cmsgh; cmsgh = CMSG_NXTHDR(&msg, cmsgh)) {
|
||||||
|
diff --git a/ping/ping6_common.c b/ping/ping6_common.c
|
||||||
|
index 986210b..b0aa66b 100644
|
||||||
|
--- a/ping/ping6_common.c
|
||||||
|
+++ b/ping/ping6_common.c
|
||||||
|
@@ -482,11 +482,8 @@ int ping6_receive_error_msg(struct ping_rts *rts, socket_st *sock)
|
||||||
|
msg.msg_controllen = sizeof(cbuf);
|
||||||
|
|
||||||
|
res = recvmsg(sock->fd, &msg, MSG_ERRQUEUE | MSG_DONTWAIT);
|
||||||
|
- if (res < 0) {
|
||||||
|
- if (errno == EAGAIN || errno == EINTR)
|
||||||
|
- local_errors++;
|
||||||
|
+ if (res < 0)
|
||||||
|
goto out;
|
||||||
|
- }
|
||||||
|
|
||||||
|
e = NULL;
|
||||||
|
for (cmsg = CMSG_FIRSTHDR(&msg); cmsg; cmsg = CMSG_NXTHDR(&msg, cmsg)) {
|
||||||
|
--
|
||||||
|
2.33.0
|
||||||
Loading…
x
Reference in New Issue
Block a user