Compare commits

...

11 Commits

Author SHA1 Message Date
openeuler-ci-bot
acc257a7bb
!39 fix ipv6 udp error
From: @yangl777 
Reviewed-by: @robertxw 
Signed-off-by: @robertxw
2023-11-27 07:32:03 +00:00
yangl777
503d39bd00 fix ipv6 udp error 2023-11-24 17:12:49 +08:00
openeuler-ci-bot
a246d28e6f
!30 fix xmtr cannot start in xface4 environment
From: @li_yunq 
Reviewed-by: @zengwefeng 
Signed-off-by: @zengwefeng
2022-08-05 09:23:03 +00:00
liyunqing_kl
d41e424ce4 fix xmtr cannot start in xface4 environment 2022-07-18 14:30:44 +08:00
openeuler-ci-bot
a782f4f0fe !21 modify net-xmtr.desktop file for Xfce4 Traceroute
From: @zhang__3125
Reviewed-by: @zengwefeng
Signed-off-by: @zengwefeng
2021-05-29 14:38:51 +08:00
linz
d4f995a4a1 modify net-xmtr.desktop file for Xfce4 Traceroute 2021-05-28 15:55:13 +08:00
openeuler-ci-bot
c83812c07d !8 update to mtr-0.93
Merge pull request !8 from lunankun/openEuler-20.03-LTS
2020-08-29 19:41:43 +08:00
lunankun
74ab5c5343 update to mtr-0.93 2020-08-25 14:58:40 +08:00
openeuler-ci-bot
5f0a8c7451 !3 update mtr.spec
Merge pull request !3 from IT砖瓦工/loc_zhuchl
2020-01-21 09:35:19 +08:00
IT砖瓦工
8d4f7f0da7 update mtr.spec. 2020-01-19 10:10:16 +08:00
openeuler-ci-bot
ca6f41d9b0 !2 delete unused info
Merge pull request !2 from IT砖瓦工/loc_zhuchl
2020-01-11 22:54:54 +08:00
5 changed files with 104 additions and 6 deletions

View File

@ -0,0 +1,78 @@
From 513c04b02ff0632ad9c84b2d9b0f3dbf3a25c0b2 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Markus=20K=C3=B6tter?= <koetter@luis.uni-hannover.de>
Date: Wed, 15 Jan 2020 15:42:58 +0100
Subject: [PATCH] ip6 udp - fix probes with local or remote port
only set the remote port in raw packet, not as sendto parameter
does not fix local and remote port, seq number is checksum then,
payload has to be adjusted as with ipv4
Conflict: NA
Reference:https://github.com/traviscross/mtr/pull/331/commits/513c04b02ff0632ad9c84b2d9b0f3dbf3a25c0b2
---
packet/probe_unix.c | 18 +++++++++++++-----
1 file changed, 13 insertions(+), 5 deletions(-)
diff --git a/packet/probe_unix.c b/packet/probe_unix.c
index bf1e2c9..a749f7d 100644
--- a/packet/probe_unix.c
+++ b/packet/probe_unix.c
@@ -52,9 +52,12 @@ int send_packet(
int packet_size,
const struct sockaddr_storage *sockaddr)
{
+ struct sockaddr_storage dst;
int send_socket = 0;
int sockaddr_length;
+ memcpy(&dst, sockaddr, sizeof(struct sockaddr_storage));
+
if (sockaddr->ss_family == AF_INET6) {
sockaddr_length = sizeof(struct sockaddr_in6);
@@ -67,12 +70,17 @@ int send_packet(
} else if (param->protocol == IPPROTO_UDP) {
if (net_state->platform.ip6_socket_raw) {
send_socket = net_state->platform.udp6_send_socket;
+ /* we got a ipv6 udp raw socket
+ * the remote port is in the payload
+ * we do not set in the sockaddr
+ */
+ *sockaddr_port_offset(&dst) = 0;
} else {
send_socket = net_state->platform.ip6_txrx_udp_socket;
if (param->dest_port) {
- *sockaddr_port_offset(sockaddr) = htons(param->dest_port);
+ *sockaddr_port_offset(&dst) = htons(param->dest_port);
} else {
- *sockaddr_port_offset(sockaddr) = sequence;
+ *sockaddr_port_offset(&dst) = sequence;
}
}
}
@@ -91,9 +99,9 @@ int send_packet(
} else if (param->protocol == IPPROTO_UDP) {
send_socket = net_state->platform.ip4_txrx_udp_socket;
if (param->dest_port) {
- *sockaddr_port_offset(sockaddr) = htons(param->dest_port);
+ *sockaddr_port_offset(&dst) = htons(param->dest_port);
} else {
- *sockaddr_port_offset(sockaddr) = sequence;
+ *sockaddr_port_offset(&dst) = sequence;
}
}
}
@@ -105,7 +113,7 @@ int send_packet(
}
return sendto(send_socket, packet, packet_size, 0,
- (struct sockaddr *) sockaddr, sockaddr_length);
+ (struct sockaddr *) &dst, sockaddr_length);
}
/*
--
2.30.0

Binary file not shown.

BIN
mtr-0.93.tar.gz Normal file

Binary file not shown.

View File

@ -7,4 +7,4 @@ if [ "$XDG_SESSION_TYPE" = wayland ]; then
exit 1
fi
/usr/bin/pkexec /usr/bin/xmtr.bin
/usr/bin/pkexec env DISPLAY=$DISPLAY XAUTHORITY=$XAUTHORITY /usr/bin/xmtr.bin

View File

@ -1,8 +1,8 @@
%global _hardened_build 1
Name: mtr
Version: 0.92
Release: 8
Version: 0.93
Release: 4
Epoch: 2
Summary: Ping and Traceroute Network Diagnostic Tool
License: GPLv2 and BSD
@ -11,6 +11,8 @@ Source0: https://github.com/traviscross/mtr/archive/v%{version}/%{name}-%{
Source1: net-x%{name}.desktop
Source2: mtr-gtk-pkexec-wrapper.sh
Patch6000: backport-ip6-udp-fix-probes-with-local-or-remote-port.patch
BuildRequires: git autoconf automake libtool ncurses-devel gtk2-devel desktop-file-utils
Provides: %{name}-gtk = %{epoch}:%{version}-%{release}
@ -25,7 +27,7 @@ and percentage for all network hops between the systems.
%package_help
%prep
%autosetup -n %{name}-%{version}
%autosetup -n %{name}-%{version} -p1
%build
export CFLAGS="%{optflags} -fPIE"
@ -64,11 +66,29 @@ make test
%files help
%defattr(-,root,root)
%doc NEWS README SECURITY TODO
%doc NEWS README.md SECURITY TODO
%{_mandir}/man8/*
%changelog
* Wed Jan 11 2020 openEuler Buildteam <buildteam@openeuler.org> - 2:0.92-8
* Fri Nov 24 2023 yanglu <yanglu72@h-partners.cn> - 2:0.93-4
- Type:bugfix
- ID:NA
- SUG:NA
- DESC:fix ipv6 udp error
* Mon Jul 18 2022 liyunqing <liyunqing@kylinos.cn> - 2:0.93-3
- modify fix xmtr cannot start in Xface4 environment
* Fri May 28 2021 zhanglin <lin.zhang@turbolinux.com.cn> - 2:0.93-2
- modify net-xmtr.desktop file for Xfce4 Traceroute
* Wed Aug 19 2020 lunankun <lunankun@huawei.com> - 2:0.93-1
- Type:requirement
- ID:NA
- SUG:NA
- DESC:update to 1.93-1
* Sat Jan 11 2020 openEuler Buildteam <buildteam@openeuler.org> - 2:0.92-8
- Type:NA
- ID:NA
- SUG:NA