From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) by finch.gentoo.org (Postfix) with ESMTP id 932FB59CA3 for ; Mon, 7 Mar 2016 15:50:25 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id BD71521C00F; Mon, 7 Mar 2016 15:50:21 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 43C2021C00F for ; Mon, 7 Mar 2016 15:50:21 +0000 (UTC) Received: from oystercatcher.gentoo.org (unknown [IPv6:2a01:4f8:202:4333:225:90ff:fed9:fc84]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 8C606340976 for ; Mon, 7 Mar 2016 15:50:19 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 4B2911607 for ; Mon, 7 Mar 2016 15:50:16 +0000 (UTC) From: "Lars Wendler" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Lars Wendler" Message-ID: <1457365812.f300a385b4d4a54333b686d25db2a652360e3ac9.polynomial-c@gentoo> Subject: [gentoo-commits] repo/gentoo:master commit in: net-misc/iputils/, net-misc/iputils/files/ X-VCS-Repository: repo/gentoo X-VCS-Files: net-misc/iputils/files/iputils-20150815-defines_and_libs.patch net-misc/iputils/files/iputils-20150815-handle_single_protocol_system.patch net-misc/iputils/files/iputils-20150815-ping6_crypto.patch net-misc/iputils/files/iputils-20150815-ping_default_ipv4.patch net-misc/iputils/iputils-20150815-r1.ebuild X-VCS-Directories: net-misc/iputils/ net-misc/iputils/files/ X-VCS-Committer: polynomial-c X-VCS-Committer-Name: Lars Wendler X-VCS-Revision: f300a385b4d4a54333b686d25db2a652360e3ac9 X-VCS-Branch: master Date: Mon, 7 Mar 2016 15:50:16 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Archives-Salt: 5b6f193e-87de-42a4-916c-5e8c5e5fef25 X-Archives-Hash: af4e1a5318b3cdc56ca5cb2b3061f6ed commit: f300a385b4d4a54333b686d25db2a652360e3ac9 Author: Lars Wendler gentoo org> AuthorDate: Mon Mar 7 15:49:42 2016 +0000 Commit: Lars Wendler gentoo org> CommitDate: Mon Mar 7 15:50:12 2016 +0000 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=f300a385 net-misc/iputils: Replaced two patches with upstream equivalents. Package-Manager: portage-2.2.27 Signed-off-by: Lars Wendler gentoo.org> .../files/iputils-20150815-defines_and_libs.patch | 28 +++++++++ ...ls-20150815-handle_single_protocol_system.patch | 70 ++++++++++++++++++++++ .../files/iputils-20150815-ping6_crypto.patch | 29 --------- .../files/iputils-20150815-ping_default_ipv4.patch | 65 -------------------- net-misc/iputils/iputils-20150815-r1.ebuild | 8 +-- 5 files changed, 102 insertions(+), 98 deletions(-) diff --git a/net-misc/iputils/files/iputils-20150815-defines_and_libs.patch b/net-misc/iputils/files/iputils-20150815-defines_and_libs.patch new file mode 100644 index 0000000..4def935 --- /dev/null +++ b/net-misc/iputils/files/iputils-20150815-defines_and_libs.patch @@ -0,0 +1,28 @@ +From ba739daf98450fe725569724eefc64a2afdeb909 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Pavel=20=C5=A0imerda?= +Date: Thu, 20 Aug 2015 16:16:14 +0200 +Subject: [PATCH] ping: fix defines and libs in Makefile + +--- + Makefile | 8 ++++---- + 1 file changed, 4 insertions(+), 4 deletions(-) + +diff --git a/Makefile b/Makefile +index 9b0b70f..4eea516 100644 +--- a/Makefile ++++ b/Makefile +@@ -153,10 +153,10 @@ DEF_clockdiff = $(DEF_CAP) + LIB_clockdiff = $(LIB_CAP) + + # ping / ping6 +-DEF_ping_common = $(DEF_CAP) $(DEF_IDN) +-DEF_ping6_common = $(DEF_CAP) $(DEF_IDN) +-DEF_ping = $(DEF_CAP) $(DEF_IDN) $(DEF_WITHOUT_IFADDRS) +-LIB_ping = $(LIB_CAP) $(LIB_IDN) $(LIB_RESOLV) ++DEF_ping = $(DEF_CAP) $(DEF_IDN) $(DEF_CRYPTO) $(DEF_WITHOUT_IFADDRS) ++DEF_ping_common = $(DEF_ping) ++DEF_ping6_common = $(DEF_ping) ++LIB_ping = $(LIB_CAP) $(LIB_IDN) $(LIB_CRYPTO) $(LIB_RESOLV) + + ping: ping_common.o ping6_common.o + ping.o ping_common.o ping6_common.o: ping.h in6_flowlabel.h diff --git a/net-misc/iputils/files/iputils-20150815-handle_single_protocol_system.patch b/net-misc/iputils/files/iputils-20150815-handle_single_protocol_system.patch new file mode 100644 index 0000000..1bf98cc --- /dev/null +++ b/net-misc/iputils/files/iputils-20150815-handle_single_protocol_system.patch @@ -0,0 +1,70 @@ +From 9fd870a4bac0b8b2070c38452f378ef1eb7d460a Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Pavel=20=C5=A0imerda?= +Date: Fri, 21 Aug 2015 00:55:56 +0200 +Subject: [PATCH] ping: handle single protocol systems + +--- + ping.c | 28 ++++++++++++++++++---------- + 1 file changed, 18 insertions(+), 10 deletions(-) + +diff --git a/ping.c b/ping.c +index ec9708e..95a10a7 100644 +--- a/ping.c ++++ b/ping.c +@@ -110,26 +110,26 @@ static struct sockaddr_in source = { .sin_family = AF_INET }; + static char *device; + static int pmtudisc = -1; + +-static void create_socket(socket_st *sock, int family, int socktype, int protocol) ++static void create_socket(socket_st *sock, int family, int socktype, int protocol, int requisite) + { + errno = 0; + + sock->fd = socket(family, socktype, protocol); + +- /* Fallback to raw socket when ping socket failed */ +- if (sock->fd == -1 && socktype == SOCK_DGRAM) { ++ /* Attempt creating a raw socket when ping socket failed */ ++ if (sock->fd == -1 && errno != EAFNOSUPPORT && socktype == SOCK_DGRAM) { + if (options & F_VERBOSE) + fprintf(stderr, "ping: socket: %s, attempting raw socket...\n", strerror(errno)); +- create_socket(sock, family, SOCK_RAW, protocol); ++ create_socket(sock, family, SOCK_RAW, protocol, requisite); + return; + } + + if (sock->fd == -1) { +- if (socktype == SOCK_RAW) +- fprintf(stderr, "ping: socket: %s (raw socket required by specified options).\n", strerror(errno)); +- else ++ if (requisite || errno != EAFNOSUPPORT || options & F_VERBOSE) + fprintf(stderr, "ping: socket: %s\n", strerror(errno)); +- exit(2); ++ if (requisite) ++ exit(2); ++ return; + } + + sock->socktype = socktype; +@@ -442,11 +442,19 @@ main(int argc, char **argv) + /* Create sockets */ + enable_capability_raw(); + if (hints.ai_family != AF_INET6) +- create_socket(&sock4, AF_INET, hints.ai_socktype, IPPROTO_ICMP); ++ create_socket(&sock4, AF_INET, hints.ai_socktype, IPPROTO_ICMP, hints.ai_family == AF_INET); + if (hints.ai_family != AF_INET) +- create_socket(&sock6, AF_INET6, hints.ai_socktype, IPPROTO_ICMPV6); ++ create_socket(&sock6, AF_INET6, hints.ai_socktype, IPPROTO_ICMPV6, sock4.fd == -1); + disable_capability_raw(); + ++ /* Limit address family on single-protocol systems */ ++ if (hints.ai_family == AF_UNSPEC) { ++ if (sock4.fd == -1) ++ hints.ai_family = AF_INET6; ++ else if (sock6.fd == -1) ++ hints.ai_family = AF_INET; ++ } ++ + /* Set socket options */ + if (settos) + set_socket_option(&sock4, IPPROTO_IP, IP_TOS, &settos, sizeof settos); diff --git a/net-misc/iputils/files/iputils-20150815-ping6_crypto.patch b/net-misc/iputils/files/iputils-20150815-ping6_crypto.patch deleted file mode 100644 index 1e236ee..0000000 --- a/net-misc/iputils/files/iputils-20150815-ping6_crypto.patch +++ /dev/null @@ -1,29 +0,0 @@ -From a45b719645960c9bacb430e452192d6ffac5be19 Mon Sep 17 00:00:00 2001 -From: Lars Wendler -Date: Thu, 20 Aug 2015 13:43:47 +0200 -Subject: [PATCH] Let ping6 use crypto if enabled. - -Signed-off-by: Lars Wendler ---- - Makefile | 4 ++-- - 1 file changed, 2 insertions(+), 2 deletions(-) - -diff --git a/Makefile b/Makefile -index e34be5b..d4cb6c0 100644 ---- a/Makefile -+++ b/Makefile -@@ -159,9 +159,9 @@ LIB_clockdiff = $(LIB_CAP) - - # ping / ping6 - DEF_ping_common = $(DEF_CAP) $(DEF_IDN) --DEF_ping6_common = $(DEF_CAP) $(DEF_IDN) -+DEF_ping6_common = $(DEF_CAP) $(DEF_IDN) $(DEF_CRYPTO) - DEF_ping = $(DEF_CAP) $(DEF_IDN) $(DEF_WITHOUT_IFADDRS) $(DEF_IPV4) --LIB_ping = $(LIB_CAP) $(LIB_IDN) $(LIB_RESOLV) -+LIB_ping = $(LIB_CAP) $(LIB_IDN) $(LIB_RESOLV) $(LIB_CRYPTO) - - ping: ping_common.o ping6_common.o - ping.o ping_common.o ping6_common.o: ping.h in6_flowlabel.h --- -2.5.0 - diff --git a/net-misc/iputils/files/iputils-20150815-ping_default_ipv4.patch b/net-misc/iputils/files/iputils-20150815-ping_default_ipv4.patch deleted file mode 100644 index 71d32f0..0000000 --- a/net-misc/iputils/files/iputils-20150815-ping_default_ipv4.patch +++ /dev/null @@ -1,65 +0,0 @@ -From 8d4d34eea9fbd25d0103975f366799764bbc4a2f Mon Sep 17 00:00:00 2001 -From: Lars Wendler -Date: Thu, 20 Aug 2015 11:47:22 +0200 -Subject: [PATCH] Add possibility to make ping use IPv4 by default. - -Using ping with a linux kernel without IPv6 capability yields to the -following problem: - -> ping www.google.de -ping: socket: Address family not supported by protocol (raw socket -required by specified options). -> - -because ping is using IPv6 by default when -4 option is omitted. - -Signed-off-by: Lars Wendler ---- - Makefile | 7 ++++++- - ping.c | 5 +++++ - 2 files changed, 11 insertions(+), 1 deletion(-) - -diff --git a/Makefile b/Makefile -index 8b37c42..e34be5b 100644 ---- a/Makefile -+++ b/Makefile -@@ -114,6 +114,11 @@ ifeq ($(ENABLE_PING6_RTHDR),RFC3542) - endif - endif - -+# DEFAULT TO IPV4 -+ifneq ($(IPV4_DEFAULT),no) -+ DEF_IPV4 = -DIPV4_DEFAULT -+endif -+ - # ------------------------------------- - TARGETS=ping tracepath tracepath6 traceroute6 clockdiff rdisc arping tftpd rarpd - -@@ -155,7 +160,7 @@ LIB_clockdiff = $(LIB_CAP) - # ping / ping6 - DEF_ping_common = $(DEF_CAP) $(DEF_IDN) - DEF_ping6_common = $(DEF_CAP) $(DEF_IDN) --DEF_ping = $(DEF_CAP) $(DEF_IDN) $(DEF_WITHOUT_IFADDRS) -+DEF_ping = $(DEF_CAP) $(DEF_IDN) $(DEF_WITHOUT_IFADDRS) $(DEF_IPV4) - LIB_ping = $(LIB_CAP) $(LIB_IDN) $(LIB_RESOLV) - - ping: ping_common.o ping6_common.o -diff --git a/ping.c b/ping.c -index ec9708e..a08a03e 100644 ---- a/ping.c -+++ b/ping.c -@@ -439,6 +439,11 @@ main(int argc, char **argv) - - target = argv[argc-1]; - -+#ifdef IPV4_DEFAULT -+ if (hints.ai_family == AF_UNSPEC) -+ hints.ai_family = AF_INET; -+#endif -+ - /* Create sockets */ - enable_capability_raw(); - if (hints.ai_family != AF_INET6) --- -2.5.0 - diff --git a/net-misc/iputils/iputils-20150815-r1.ebuild b/net-misc/iputils/iputils-20150815-r1.ebuild index a23f1b9..5227963 100644 --- a/net-misc/iputils/iputils-20150815-r1.ebuild +++ b/net-misc/iputils/iputils-20150815-r1.ebuild @@ -1,4 +1,4 @@ -# Copyright 1999-2015 Gentoo Foundation +# Copyright 1999-2016 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 # $Id$ @@ -7,7 +7,7 @@ # building stages, and when the jade/sgml packages are broken (which # seems to be more common than would be nice). -EAPI="4" +EAPI=5 inherit flag-o-matic eutils toolchain-funcs fcaps if [[ ${PV} == "99999999" ]] ; then @@ -58,8 +58,8 @@ S=${WORKDIR}/${PN}-s${PV} PATCHES=( "${FILESDIR}/021109-uclibc-no-ether_ntohost.patch" - "${FILESDIR}/${PN}-20150815-ping_default_ipv4.patch" - "${FILESDIR}/${PN}-20150815-ping6_crypto.patch" + "${FILESDIR}/${PN}-20150815-defines_and_libs.patch" + "${FILESDIR}/${PN}-20150815-handle_single_protocol_system.patch" ) src_prepare() {