Accepting request 399117 from network:utilities

Automatic submission by obs-autosubmit

OBS-URL: https://build.opensuse.org/request/show/399117
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/iputils?expand=0&rev=35
This commit is contained in:
Dominique Leuenberger 2016-06-03 14:36:59 +00:00 committed by Git OBS Bridge
commit 1a7ec90e34
10 changed files with 212 additions and 1248 deletions

File diff suppressed because it is too large Load Diff

View File

@ -1,13 +0,0 @@
--- ifenslave.c
+++ ifenslave.c
@@ -520,8 +520,8 @@ static int if_getconfig(char *ifname)
if (ioctl(skfd, SIOCGIFADDR, &ifr) < 0)
return -1;
printf("The result of SIOCGIFADDR is %2.2x.%2.2x.%2.2x.%2.2x.\n",
- ifr.ifr_addr.sa_data[0], ifr.ifr_addr.sa_data[1],
- ifr.ifr_addr.sa_data[2], ifr.ifr_addr.sa_data[3]);
+ ifr.ifr_addr.sa_data[2] & 0xff, ifr.ifr_addr.sa_data[3] & 0xff,
+ ifr.ifr_addr.sa_data[4] & 0xff, ifr.ifr_addr.sa_data[5] & 0xff);
strcpy(ifr.ifr_name, ifname);
if (ioctl(skfd, SIOCGIFHWADDR, &ifr) < 0)

View File

@ -8,19 +8,19 @@ Signed-off-by: Hannes Reinecke <hare@suse.de>
ping.c | 9 +++++++++ ping.c | 9 +++++++++
1 file changed, 9 insertions(+) 1 file changed, 9 insertions(+)
diff --git a/ping.c b/ping.c Index: iputils/ping.c
index 0357c3d..83a7aad 100644 ===================================================================
--- a/ping.c --- iputils.orig/ping.c
+++ b/ping.c +++ iputils/ping.c
@@ -103,6 +103,7 @@ static void usage(void) __attribute__((noreturn)); @@ -96,6 +96,7 @@ static void usage(void) __attribute__((n
static u_short in_cksum(const u_short *addr, int len, u_short salt); static unsigned short in_cksum(const unsigned short *addr, int len, unsigned short salt);
static void pr_icmph(__u8 type, __u8 code, __u32 info, struct icmphdr *icp); static void pr_icmph(__u8 type, __u8 code, __u32 info, struct icmphdr *icp);
static int parsetos(char *str); static int parsetos(char *str);
+static void doexit (int); +static void doexit (int);
static struct { static struct {
struct cmsghdr cm; struct cmsghdr cm;
@@ -262,6 +263,8 @@ main(int argc, char **argv) @@ -514,6 +515,8 @@ int ping4_run(int argc, char **argv, str
options |= F_SOURCEROUTE; options |= F_SOURCEROUTE;
} }
} }
@ -29,8 +29,8 @@ index 0357c3d..83a7aad 100644
while (argc > 0) { while (argc > 0) {
target = *argv; target = *argv;
@@ -1398,3 +1401,9 @@ void usage(void) @@ -1627,3 +1630,9 @@ void usage(void)
); ping6_usage(1);
exit(2); exit(2);
} }
+ +
@ -39,6 +39,3 @@ index 0357c3d..83a7aad 100644
+ exit (1); + exit (1);
+} +}
+ +
--
1.8.1.4

View File

@ -12,45 +12,24 @@ diff --git a/ping.c b/ping.c
index b9d649531621..f9f4a28f5dc1 100644 index b9d649531621..f9f4a28f5dc1 100644
--- a/ping.c --- a/ping.c
+++ b/ping.c +++ b/ping.c
@@ -654,17 +654,6 @@ int receive_error_msg() @ -898,17 +898,6 @@
acknowledge(ntohs(icmph.un.echo.sequence)); acknowledge(ntohs(icmph.un.echo.sequence));
- if (!working_recverr) { - if (sock->socktype == SOCK_RAW && !sock->working_recverr) {
- struct icmp_filter filt; - struct icmp_filter filt;
- working_recverr = 1; - sock->working_recverr = 1;
- /* OK, it works. Add stronger filter. */ - /* OK, it works. Add stronger filter. */
- filt.data = ~((1<<ICMP_SOURCE_QUENCH)| - filt.data = ~((1<<ICMP_SOURCE_QUENCH)|
- (1<<ICMP_REDIRECT)| - (1<<ICMP_REDIRECT)|
- (1<<ICMP_ECHOREPLY)); - (1<<ICMP_ECHOREPLY));
- if (setsockopt(icmp_sock, SOL_RAW, ICMP_FILTER, (char*)&filt, sizeof(filt)) == -1) - if (setsockopt(sock->fd, SOL_RAW, ICMP_FILTER, (char*)&filt, sizeof(filt)) == -1)
- perror("\rWARNING: setsockopt(ICMP_FILTER)"); - perror("\rWARNING: setsockopt(ICMP_FILTER)");
- } - }
- -
net_errors++; net_errors++;
nerrors++; nerrors++;
if (options & F_QUIET) if (options & F_QUIET)
@@ -820,19 +809,7 @@ parse_reply(struct msghdr *msg, int cc, void *addr, struct timeval *tv)
icp->type != ICMP_SOURCE_QUENCH);
if (error_pkt) {
acknowledge(ntohs(icp1->un.echo.sequence));
- if (working_recverr) {
- return 0;
- } else {
- static int once;
- /* Sigh, IP_RECVERR for raw socket
- * was broken until 2.4.9. So, we ignore
- * the first error and warn on the second.
- */
- if (once++ == 1)
- fprintf(stderr, "\rWARNING: kernel is not very fresh, upgrade is recommended.\n");
- if (once == 1)
- return 0;
- }
+ return 0;
}
nerrors+=error_pkt;
if (options&F_QUIET)
-- --
2.3.5 2.3.5

View File

@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:450f549fc5b620c23c5929aa6d54b7ddfc7ee1cb1e8efdc5e8bb21d8d0c5319f
size 155344

View File

@ -15,14 +15,15 @@ Signed-off-by: Hannes Reinecke <hare@suse.de>
ping.c | 10 ++++++++++ ping.c | 10 ++++++++++
1 file changed, 10 insertions(+) 1 file changed, 10 insertions(+)
diff --git a/ping.c b/ping.c Index: iputils/ping.c
index 71b445d..0357c3d 100644 ===================================================================
--- a/ping.c --- iputils.orig/ping.c
+++ b/ping.c +++ iputils/ping.c
@@ -139,6 +139,16 @@ main(int argc, char **argv) @@ -443,6 +443,17 @@ main(int argc, char **argv)
/* Create sockets */
enable_capability_raw(); enable_capability_raw();
+
+ /* + /*
+ * ping depend on SIGALARM to exit sometimes, + * ping depend on SIGALARM to exit sometimes,
+ * but to popen, system, fork carry on parent signal handler + * but to popen, system, fork carry on parent signal handler
@ -33,9 +34,6 @@ index 71b445d..0357c3d 100644
+ sigprocmask(SIG_UNBLOCK, &s, NULL); + sigprocmask(SIG_UNBLOCK, &s, NULL);
+ set_signal(SIGALRM, doexit); + set_signal(SIGALRM, doexit);
+ +
icmp_sock = socket(AF_INET, SOCK_RAW, IPPROTO_ICMP); if (hints.ai_family != AF_INET6)
socket_errno = errno; create_socket(&sock4, AF_INET, hints.ai_socktype, IPPROTO_ICMP, hints.ai_family == AF_INET);
if (hints.ai_family != AF_INET)
--
1.8.1.4

View File

@ -1,25 +0,0 @@
From 9c60c5877436c2feabe55ff91f6d279564fe1a31 Mon Sep 17 00:00:00 2001
From: Hannes Reinecke <hare@suse.de>
Date: Thu, 23 Jan 2014 10:32:36 +0100
Subject: traceroute6: Include stdint.h
Signed-off-by: Hannes Reinecke <hare@suse.de>
---
traceroute6.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/traceroute6.c b/traceroute6.c
index 0538d4b..7205fa3 100644
--- a/traceroute6.c
+++ b/traceroute6.c
@@ -230,6 +230,7 @@ char copyright[] =
* Tue Dec 20 03:50:13 PST 1988
*/
+#include <stdint.h>
#include <sys/param.h>
#include <sys/time.h>
#include <sys/socket.h>
--
1.8.1.4

View File

@ -1,3 +1,131 @@
-------------------------------------------------------------------
Tue May 24 09:28:43 UTC 2016 - meissner@suse.com
- do not install rarpd and rarpd.8 manpage (comes from rarpd rpm currently)
-------------------------------------------------------------------
Tue May 17 16:15:24 UTC 2016 - mchandras@suse.de
- Update to version s20160308 (Changes taken from the RELNOTES file)
* use syntax compatible with busybox date in Makefile
* 'admin prohibited' should print !X not !S.
* Makefile: use #define as in previous code changes
* doc/Makefile: require bash, because we use pushd and popd
* doc: don't timestamp manpages by default
* ping: status() now returns received/transmitted instead of trans/recv
* ping: don't mess with internals of struct msghdr
* ping: ICMP error replies while errno < 0 is a hard error
* ping: always use POSIX locale when parsing -i
* ping: link against libm
* made ping functions protocol independent
* ping: perform dual-stack ping by default
* ping: remove obsolete preprocessor directives
* ping: avoid name clashes between IPv4 and IPv6 code
* ping: merge all ping header files into a single one
* ping: merge `ping6` command into `ping`
* ping: refactor ping options
* ping: refactor ping socket code
* ping: merge IPv4 and IPv6 `pr_addr()`
* ping: fix defines and libs in Makefile
* ping: handle single protocol systems
* iputils ping/ping6: Add a function to check if a packet is ours
* ping: Add <linux/types.h> to fix compilation error.
* ping6: Use GNUTLS API directly for MD5. (v2)
* ping6: Use libgcrypt instead of gnutls for MD5.
* Allow ping to use IPv6 addresses
* ping,ping6 doc: More description on CAP_NET_RAW usage.
* if IPv4 resolving fails fallback to ping6
* ping: in usage print the 'ping -6' options as well
* ping: allow option -4 which forces IPv4
* combine sock and errno into a single structure
* This patch allows running ping and ping6 without root privileges on
* use better names for socket variables
* tracepath,doc: fix corrupted tag
* doc: ping: add missing options and remove ping6
* ninfod: remove unused variables
* ninfod: Regenerate configure by autoconf-2.69.
* ninfod: libgcrypt support.
* Fix building with musl
* travis.yml: install nettle-dev
* Allow using nettle instead of libgcrypt for MD5
* avoid compiler warning caused by snapshot.h
* make `getaddrinfo()` and `getnameinfo()` usage consistent
* enable IDN by default
* remove IPV4_TARGETS and IPV6_TARGETS
* Use svg instead of png to get better image quality
* spec: Configure before building ninfod.
* spec: Fix date in %changelog.
* make,spec: Add rpm target.
- Refreshed patches
* iputils-ping-interrupt.diff
* iputils-sec-ping-unblock.diff
- Remove ifenslave.c. It has been removed in the linux kernel commit
b1098bbe1b24("bonding: remove ifenslave.c from kernel source").
bonding can be done via iproute (netlink)
- dropped iputils-ifenslave.diff
- Append our CFLAGS to the upstream ones instead of overriding them.
- Cleanup old make command since the upstream Makefile does things right
it seems.
- Use Provides: for old /{,s}bin utils to satisfy reverse dependencies.
- Install utilities to /bin and /sbin until reverse dependencies are
properly fixed.
- Do not install tftp and traceroute to avoid conflicts with the tftp and
traceroute packages. Stick to what iputils used to provide in the past.
- Remove iputils-traceroute6-stdint.diff patch since we are not building
the traceroute* utilities.
- Install tracepath to /usr/bin. (boo#795788)
-------------------------------------------------------------------
Tue Dec 1 13:39:07 UTC 2015 - p.drouand@gmail.com
- Update to version s20150815
* use syntax compatible with busybox date in Makefile
* Makefile: use #define as in previous code changes
* ping: status() now returns received/transmitted instead of trans/recv
* ping: don't mess with internals of struct msghdr
* tracepath,doc: fix corrupted tag
* made ping functions protocol independent
* Allow ping to use IPv6 addresses
* if IPv4 resolving fails fallback to ping6
* ping: in usage print the 'ping -6' options as well
* ping: allow option -4 which forces IPv4
* combine sock and errno into a single structure
* This patch allows running ping and ping6 without root privileges on
* use better names for socket variables
* travis.yml: install nettle-dev
* Allow using nettle instead of libgcrypt for MD5
* avoid compiler warning caused by snapshot.h
* make `getaddrinfo()` and `getnameinfo()` usage consistent
* enable IDN by default
* ping: perform dual-stack ping by default
* remove IPV4_TARGETS and IPV6_TARGETS
* ping: remove obsolete preprocessor directives
* ping: avoid name clashes between IPv4 and IPv6 code
* ping: merge all ping header files into a single one
* ping: merge `ping6` command into `ping`
* ping: refactor ping options
* ping: refactor ping socket code
* ping: merge IPv4 and IPv6 `pr_addr()`
* Use svg instead of png to get better image quality
* iputils ping/ping6: Add a function to check if a packet is ours
* ping: Add <linux/types.h> to fix compilation error.
* ping6: Use GNUTLS API directly for MD5. (v2)
* ping6: Use libgcrypt instead of gnutls for MD5.
* ninfod: Regenerate configure by autoconf-2.69.
* ninfod: libgcrypt support.
* spec: Configure before building ninfod.
* spec: Fix date in %changelog.
* make,spec: Add rpm target.
* ping,ping6 doc: More description on CAP_NET_RAW usage.
- Update patches
* iputils-s20101006-ping-interrupt.diff > iputils-ping-interrupt.diff
* iputils-s20101006-sec-ping-unblock.diff > iputils-sec-ping-unblock.diff
* iputils-remove-bogus-check-required-for-2.4.9-kernels.patch
- Update home project page and download Url
- Remove obsolete %clean section
- Remove UsrMerge process; it has been done for more than two
openSUSE releases now
------------------------------------------------------------------- -------------------------------------------------------------------
Mon Apr 20 17:07:42 CEST 2015 - tiwai@suse.de Mon Apr 20 17:07:42 CEST 2015 - tiwai@suse.de

View File

@ -1,7 +1,7 @@
# #
# spec file for package iputils # spec file for package iputils
# #
# Copyright (c) 2015 SUSE LINUX GmbH, Nuernberg, Germany. # Copyright (c) 2016 SUSE LINUX GmbH, Nuernberg, Germany.
# #
# All modifications and additions to the file contributed by third parties # All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed # remain the property of their copyright owners, unless otherwise agreed
@ -23,104 +23,107 @@ BuildRequires: libcap-devel
BuildRequires: libopenssl-devel BuildRequires: libopenssl-devel
BuildRequires: opensp BuildRequires: opensp
BuildRequires: perl-SGMLS BuildRequires: perl-SGMLS
BuildRequires: pkgconfig(libidn)
# For Makefile modifications
BuildRequires: sed
Summary: IPv4 and IPv6 Networking Utilities Summary: IPv4 and IPv6 Networking Utilities
License: BSD-3-Clause and GPL-2.0+ License: BSD-3-Clause and GPL-2.0+
Group: Productivity/Networking/Other Group: Productivity/Networking/Other
Version: s20121221 Version: s20160308
Release: 0 Release: 0
Url: http://www.skbuff.net/iputils Url: https://github.com/iputils/iputils
Source: http://www.skbuff.net/iputils/iputils-%{version}.tar.bz2 Source: https://github.com/iputils/iputils/archive/%{version}.tar.gz
# XXX: from linux/Documentation/networking/ifenslave.c Patch8: iputils-sec-ping-unblock.diff
Source1: ifenslave.c Patch9: iputils-ping-interrupt.diff
Patch2: iputils-traceroute6-stdint.diff
Patch3: iputils-ifenslave.diff
Patch8: iputils-s20101006-sec-ping-unblock.diff
Patch9: iputils-s20101006-ping-interrupt.diff
# PATCH-FIX-UPSTREAM iputils-remove-bogus-check-required-for-2.4.9-kernels.patch tiwai@suse.de - boo#927831 # PATCH-FIX-UPSTREAM iputils-remove-bogus-check-required-for-2.4.9-kernels.patch tiwai@suse.de - boo#927831
Patch10: iputils-remove-bogus-check-required-for-2.4.9-kernels.patch Patch10: iputils-remove-bogus-check-required-for-2.4.9-kernels.patch
BuildRoot: %{_tmppath}/%{name}-%{version}-build BuildRoot: %{_tmppath}/%{name}-%{version}-build
PreReq: permissions PreReq: permissions
# I have spotted at least two packages (yast-printer and dhcp-client) that need
# /bin/ping and /sbin/arping but they do not seem to use them with absolute
# paths so we may be lukcy and no further changes are necessary.
Provides: /bin/ping
Provides: /sbin/arping
%description %description
This package contains some small network tools for IPv4 and IPv6 like This package contains some small network tools for IPv4 and IPv6 like
rdisc, ping6, traceroute6, tracepath, and tracepath6. rdisc, ping, arping, tracepath and tracepath6.
%prep %prep
%setup -q %setup -q
cp -a %SOURCE1 .
%patch2 -p1
%patch3
%patch8 -p1 %patch8 -p1
%patch9 -p1 %patch9 -p1
%patch10 -p1 %patch10 -p1
%build %build
make %{?_smp_mflags} KERNEL_INCLUDE=$PWD \
CCOPT='%optflags -fno-strict-aliasing -fpie -D_GNU_SOURCE' \
LDLIBS='-Wl,-z,relro,-z,now -pie -lcap -lresolv' \
CAPABILITIES=1 LDFLAG_GNUTLS='-lcrypto -lssl'
gcc $RPM_OPT_FLAGS -o ifenslave ifenslave.c
# Drop LASTTAG variable since it needs git and it's not used for regular
# building
sed -i '/^LASTTAG:=/d' Makefile
# Do not link against nettle
sed -i '/^USE_NETTLE/s/yes/no/' Makefile
# Export CFLAGS so we can also benefit from the ones the Makefile sets for us
# Instead of overriding all of them.
export CFLAGS='%{optflags} -fpie'
# Pulled-in by the LINK.o variable.
export LDFLAGS='-pie -Wl,-z,relro,-z,now'
# Build only selected apps
make %{?_smp_mflags} arping clockdiff ping rdisc tracepath \
tracepath6 rarpd
make man make man
%install %install
mkdir -p $RPM_BUILD_ROOT/%_sbindir mkdir -p $RPM_BUILD_ROOT/%_sbindir
mkdir -p $RPM_BUILD_ROOT/%_bindir mkdir -p $RPM_BUILD_ROOT/%_bindir
install arping $RPM_BUILD_ROOT/%{_sbindir} install arping $RPM_BUILD_ROOT/%{_sbindir}
install ifenslave $RPM_BUILD_ROOT/%{_sbindir}
install clockdiff $RPM_BUILD_ROOT/%{_sbindir} install clockdiff $RPM_BUILD_ROOT/%{_sbindir}
install rdisc $RPM_BUILD_ROOT/%{_sbindir}/in.rdisc install rdisc $RPM_BUILD_ROOT/%{_sbindir}/in.rdisc
install tracepath $RPM_BUILD_ROOT/%{_sbindir} # boo#795788
install tracepath6 $RPM_BUILD_ROOT/%{_sbindir} install tracepath $RPM_BUILD_ROOT/%{_bindir}
install tracepath6 $RPM_BUILD_ROOT/%{_bindir}
install ping $RPM_BUILD_ROOT/%{_bindir} install ping $RPM_BUILD_ROOT/%{_bindir}
install ping6 $RPM_BUILD_ROOT/%{_bindir} #install rarpd $RPM_BUILD_ROOT/%{_bindir}
install ipg $RPM_BUILD_ROOT/%{_bindir}
#UsrMerge #UsrMerge
# We still have reverse dependencies using /sbin/* or /bin/*
# so keep these symlinks for now. They are slowly being fixed
# but lets not just break them yet.
mkdir -p $RPM_BUILD_ROOT/{bin,sbin} mkdir -p $RPM_BUILD_ROOT/{bin,sbin}
ln -sf %{_sbindir}/arping $RPM_BUILD_ROOT/sbin ln -sf %{_sbindir}/arping $RPM_BUILD_ROOT/sbin
ln -sf %{_sbindir}/ifenslave $RPM_BUILD_ROOT/sbin ln -sf %{_sbindir}/clockdiff $RPM_BUILD_ROOT/sbin
ln -sf %{_sbindir}/clockdiff $RPM_BUILD_ROOT/sbin ln -sf %{_sbindir}/in.rdisc $RPM_BUILD_ROOT/sbin
ln -sf %{_sbindir}/in.rdisc $RPM_BUILD_ROOT/sbin ln -sf %{_bindir}/tracepath $RPM_BUILD_ROOT/bin
ln -sf %{_sbindir}/tracepath $RPM_BUILD_ROOT/sbin ln -sf %{_bindir}/tracepath6 $RPM_BUILD_ROOT/bin
ln -sf %{_sbindir}/tracepath6 $RPM_BUILD_ROOT/sbin ln -sf %{_bindir}/ping $RPM_BUILD_ROOT/bin
ln -sf %{_bindir}/ping $RPM_BUILD_ROOT/bin
ln -sf %{_bindir}/ping6 $RPM_BUILD_ROOT/bin
ln -sf %{_bindir}/ipg $RPM_BUILD_ROOT/bin
#EndUsrMerge #EndUsrMerge
mkdir -p $RPM_BUILD_ROOT%_mandir/man8
install -m 644 doc/arping.8 $RPM_BUILD_ROOT%_mandir/man8/
install -m 644 doc/clockdiff.8 $RPM_BUILD_ROOT%_mandir/man8/
install -m 644 doc/tracepath.8 $RPM_BUILD_ROOT%_mandir/man8/
install -m 644 doc/ping.8 $RPM_BUILD_ROOT%_mandir/man8/
install -m 644 doc/ping.8 $RPM_BUILD_ROOT%_mandir/man8/ping6.8
install -m 644 doc/pg3.8 $RPM_BUILD_ROOT%_mandir/man8/
install -m 644 doc/rdisc.8 $RPM_BUILD_ROOT%_mandir/man8/
%clean mkdir -p $RPM_BUILD_ROOT/%{_mandir}/man8
rm -rf $RPM_BUILD_ROOT # Remove conflicting manpages
rm doc/tftpd* doc/traceroute* doc/rarpd*
# Install the rest
install -m 644 doc/*.8 $RPM_BUILD_ROOT%_mandir/man8/
%post %post
%set_permissions %{_bindir}/ping %{_bindir}/ping6 %set_permissions %{_bindir}/ping
%verifyscript %verifyscript
%verify_permissions %{_bindir}/ping %{_bindir}/ping6 %verify_permissions -e %{_bindir}/ping
%files %files
%defattr(-,root,root) %defattr(-,root,root)
%doc RELNOTES %doc RELNOTES
%verify(not mode) %attr(0755,root,root) %{_bindir}/ping
#%{_bindir}/rarpd
%{_sbindir}/arping %{_sbindir}/arping
%{_sbindir}/ifenslave
%{_sbindir}/clockdiff %{_sbindir}/clockdiff
%verify(not mode caps) %attr(4755,root,root) %{_bindir}/ping %{_bindir}/tracepath
%verify(not mode caps) %attr(4755,root,root) %{_bindir}/ping6 %{_bindir}/tracepath6
%{_bindir}/ipg
%{_sbindir}/tracepath
%{_sbindir}/tracepath6
%{_sbindir}/in.rdisc %{_sbindir}/in.rdisc
%attr(644,root,root) %_mandir/man8/*
#UsrMerge #UsrMerge
/bin/* /bin/*
/sbin/* /sbin/*
#EndUsrMerge #EndUsrMerge
%attr(644,root,root) %_mandir/man8/*
%changelog %changelog

3
s20160308.tar.gz Normal file
View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:803d11b14af1bd3852c83111cc29e904bc3ca936c093dbb419d0671d3c9d964b
size 195348