Gentoo Archives: gentoo-commits

From: Lars Wendler <polynomial-c@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: net-misc/iputils/, net-misc/iputils/files/
Date: Mon, 07 Mar 2016 15:50:25
Message-Id: 1457365812.f300a385b4d4a54333b686d25db2a652360e3ac9.polynomial-c@gentoo
1 commit: f300a385b4d4a54333b686d25db2a652360e3ac9
2 Author: Lars Wendler <polynomial-c <AT> gentoo <DOT> org>
3 AuthorDate: Mon Mar 7 15:49:42 2016 +0000
4 Commit: Lars Wendler <polynomial-c <AT> gentoo <DOT> org>
5 CommitDate: Mon Mar 7 15:50:12 2016 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=f300a385
7
8 net-misc/iputils: Replaced two patches with upstream equivalents.
9
10 Package-Manager: portage-2.2.27
11 Signed-off-by: Lars Wendler <polynomial-c <AT> gentoo.org>
12
13 .../files/iputils-20150815-defines_and_libs.patch | 28 +++++++++
14 ...ls-20150815-handle_single_protocol_system.patch | 70 ++++++++++++++++++++++
15 .../files/iputils-20150815-ping6_crypto.patch | 29 ---------
16 .../files/iputils-20150815-ping_default_ipv4.patch | 65 --------------------
17 net-misc/iputils/iputils-20150815-r1.ebuild | 8 +--
18 5 files changed, 102 insertions(+), 98 deletions(-)
19
20 diff --git a/net-misc/iputils/files/iputils-20150815-defines_and_libs.patch b/net-misc/iputils/files/iputils-20150815-defines_and_libs.patch
21 new file mode 100644
22 index 0000000..4def935
23 --- /dev/null
24 +++ b/net-misc/iputils/files/iputils-20150815-defines_and_libs.patch
25 @@ -0,0 +1,28 @@
26 +From ba739daf98450fe725569724eefc64a2afdeb909 Mon Sep 17 00:00:00 2001
27 +From: =?UTF-8?q?Pavel=20=C5=A0imerda?= <psimerda@××××××.com>
28 +Date: Thu, 20 Aug 2015 16:16:14 +0200
29 +Subject: [PATCH] ping: fix defines and libs in Makefile
30 +
31 +---
32 + Makefile | 8 ++++----
33 + 1 file changed, 4 insertions(+), 4 deletions(-)
34 +
35 +diff --git a/Makefile b/Makefile
36 +index 9b0b70f..4eea516 100644
37 +--- a/Makefile
38 ++++ b/Makefile
39 +@@ -153,10 +153,10 @@ DEF_clockdiff = $(DEF_CAP)
40 + LIB_clockdiff = $(LIB_CAP)
41 +
42 + # ping / ping6
43 +-DEF_ping_common = $(DEF_CAP) $(DEF_IDN)
44 +-DEF_ping6_common = $(DEF_CAP) $(DEF_IDN)
45 +-DEF_ping = $(DEF_CAP) $(DEF_IDN) $(DEF_WITHOUT_IFADDRS)
46 +-LIB_ping = $(LIB_CAP) $(LIB_IDN) $(LIB_RESOLV)
47 ++DEF_ping = $(DEF_CAP) $(DEF_IDN) $(DEF_CRYPTO) $(DEF_WITHOUT_IFADDRS)
48 ++DEF_ping_common = $(DEF_ping)
49 ++DEF_ping6_common = $(DEF_ping)
50 ++LIB_ping = $(LIB_CAP) $(LIB_IDN) $(LIB_CRYPTO) $(LIB_RESOLV)
51 +
52 + ping: ping_common.o ping6_common.o
53 + ping.o ping_common.o ping6_common.o: ping.h in6_flowlabel.h
54
55 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
56 new file mode 100644
57 index 0000000..1bf98cc
58 --- /dev/null
59 +++ b/net-misc/iputils/files/iputils-20150815-handle_single_protocol_system.patch
60 @@ -0,0 +1,70 @@
61 +From 9fd870a4bac0b8b2070c38452f378ef1eb7d460a Mon Sep 17 00:00:00 2001
62 +From: =?UTF-8?q?Pavel=20=C5=A0imerda?= <psimerda@××××××.com>
63 +Date: Fri, 21 Aug 2015 00:55:56 +0200
64 +Subject: [PATCH] ping: handle single protocol systems
65 +
66 +---
67 + ping.c | 28 ++++++++++++++++++----------
68 + 1 file changed, 18 insertions(+), 10 deletions(-)
69 +
70 +diff --git a/ping.c b/ping.c
71 +index ec9708e..95a10a7 100644
72 +--- a/ping.c
73 ++++ b/ping.c
74 +@@ -110,26 +110,26 @@ static struct sockaddr_in source = { .sin_family = AF_INET };
75 + static char *device;
76 + static int pmtudisc = -1;
77 +
78 +-static void create_socket(socket_st *sock, int family, int socktype, int protocol)
79 ++static void create_socket(socket_st *sock, int family, int socktype, int protocol, int requisite)
80 + {
81 + errno = 0;
82 +
83 + sock->fd = socket(family, socktype, protocol);
84 +
85 +- /* Fallback to raw socket when ping socket failed */
86 +- if (sock->fd == -1 && socktype == SOCK_DGRAM) {
87 ++ /* Attempt creating a raw socket when ping socket failed */
88 ++ if (sock->fd == -1 && errno != EAFNOSUPPORT && socktype == SOCK_DGRAM) {
89 + if (options & F_VERBOSE)
90 + fprintf(stderr, "ping: socket: %s, attempting raw socket...\n", strerror(errno));
91 +- create_socket(sock, family, SOCK_RAW, protocol);
92 ++ create_socket(sock, family, SOCK_RAW, protocol, requisite);
93 + return;
94 + }
95 +
96 + if (sock->fd == -1) {
97 +- if (socktype == SOCK_RAW)
98 +- fprintf(stderr, "ping: socket: %s (raw socket required by specified options).\n", strerror(errno));
99 +- else
100 ++ if (requisite || errno != EAFNOSUPPORT || options & F_VERBOSE)
101 + fprintf(stderr, "ping: socket: %s\n", strerror(errno));
102 +- exit(2);
103 ++ if (requisite)
104 ++ exit(2);
105 ++ return;
106 + }
107 +
108 + sock->socktype = socktype;
109 +@@ -442,11 +442,19 @@ main(int argc, char **argv)
110 + /* Create sockets */
111 + enable_capability_raw();
112 + if (hints.ai_family != AF_INET6)
113 +- create_socket(&sock4, AF_INET, hints.ai_socktype, IPPROTO_ICMP);
114 ++ create_socket(&sock4, AF_INET, hints.ai_socktype, IPPROTO_ICMP, hints.ai_family == AF_INET);
115 + if (hints.ai_family != AF_INET)
116 +- create_socket(&sock6, AF_INET6, hints.ai_socktype, IPPROTO_ICMPV6);
117 ++ create_socket(&sock6, AF_INET6, hints.ai_socktype, IPPROTO_ICMPV6, sock4.fd == -1);
118 + disable_capability_raw();
119 +
120 ++ /* Limit address family on single-protocol systems */
121 ++ if (hints.ai_family == AF_UNSPEC) {
122 ++ if (sock4.fd == -1)
123 ++ hints.ai_family = AF_INET6;
124 ++ else if (sock6.fd == -1)
125 ++ hints.ai_family = AF_INET;
126 ++ }
127 ++
128 + /* Set socket options */
129 + if (settos)
130 + set_socket_option(&sock4, IPPROTO_IP, IP_TOS, &settos, sizeof settos);
131
132 diff --git a/net-misc/iputils/files/iputils-20150815-ping6_crypto.patch b/net-misc/iputils/files/iputils-20150815-ping6_crypto.patch
133 deleted file mode 100644
134 index 1e236ee..0000000
135 --- a/net-misc/iputils/files/iputils-20150815-ping6_crypto.patch
136 +++ /dev/null
137 @@ -1,29 +0,0 @@
138 -From a45b719645960c9bacb430e452192d6ffac5be19 Mon Sep 17 00:00:00 2001
139 -From: Lars Wendler <polynomial-c@g.o>
140 -Date: Thu, 20 Aug 2015 13:43:47 +0200
141 -Subject: [PATCH] Let ping6 use crypto if enabled.
142 -
143 -Signed-off-by: Lars Wendler <polynomial-c@g.o>
144 ----
145 - Makefile | 4 ++--
146 - 1 file changed, 2 insertions(+), 2 deletions(-)
147 -
148 -diff --git a/Makefile b/Makefile
149 -index e34be5b..d4cb6c0 100644
150 ---- a/Makefile
151 -+++ b/Makefile
152 -@@ -159,9 +159,9 @@ LIB_clockdiff = $(LIB_CAP)
153 -
154 - # ping / ping6
155 - DEF_ping_common = $(DEF_CAP) $(DEF_IDN)
156 --DEF_ping6_common = $(DEF_CAP) $(DEF_IDN)
157 -+DEF_ping6_common = $(DEF_CAP) $(DEF_IDN) $(DEF_CRYPTO)
158 - DEF_ping = $(DEF_CAP) $(DEF_IDN) $(DEF_WITHOUT_IFADDRS) $(DEF_IPV4)
159 --LIB_ping = $(LIB_CAP) $(LIB_IDN) $(LIB_RESOLV)
160 -+LIB_ping = $(LIB_CAP) $(LIB_IDN) $(LIB_RESOLV) $(LIB_CRYPTO)
161 -
162 - ping: ping_common.o ping6_common.o
163 - ping.o ping_common.o ping6_common.o: ping.h in6_flowlabel.h
164 ---
165 -2.5.0
166 -
167
168 diff --git a/net-misc/iputils/files/iputils-20150815-ping_default_ipv4.patch b/net-misc/iputils/files/iputils-20150815-ping_default_ipv4.patch
169 deleted file mode 100644
170 index 71d32f0..0000000
171 --- a/net-misc/iputils/files/iputils-20150815-ping_default_ipv4.patch
172 +++ /dev/null
173 @@ -1,65 +0,0 @@
174 -From 8d4d34eea9fbd25d0103975f366799764bbc4a2f Mon Sep 17 00:00:00 2001
175 -From: Lars Wendler <polynomial-c@g.o>
176 -Date: Thu, 20 Aug 2015 11:47:22 +0200
177 -Subject: [PATCH] Add possibility to make ping use IPv4 by default.
178 -
179 -Using ping with a linux kernel without IPv6 capability yields to the
180 -following problem:
181 -
182 -> ping www.google.de
183 -ping: socket: Address family not supported by protocol (raw socket
184 -required by specified options).
185 ->
186 -
187 -because ping is using IPv6 by default when -4 option is omitted.
188 -
189 -Signed-off-by: Lars Wendler <polynomial-c@g.o>
190 ----
191 - Makefile | 7 ++++++-
192 - ping.c | 5 +++++
193 - 2 files changed, 11 insertions(+), 1 deletion(-)
194 -
195 -diff --git a/Makefile b/Makefile
196 -index 8b37c42..e34be5b 100644
197 ---- a/Makefile
198 -+++ b/Makefile
199 -@@ -114,6 +114,11 @@ ifeq ($(ENABLE_PING6_RTHDR),RFC3542)
200 - endif
201 - endif
202 -
203 -+# DEFAULT TO IPV4
204 -+ifneq ($(IPV4_DEFAULT),no)
205 -+ DEF_IPV4 = -DIPV4_DEFAULT
206 -+endif
207 -+
208 - # -------------------------------------
209 - TARGETS=ping tracepath tracepath6 traceroute6 clockdiff rdisc arping tftpd rarpd
210 -
211 -@@ -155,7 +160,7 @@ LIB_clockdiff = $(LIB_CAP)
212 - # ping / ping6
213 - DEF_ping_common = $(DEF_CAP) $(DEF_IDN)
214 - DEF_ping6_common = $(DEF_CAP) $(DEF_IDN)
215 --DEF_ping = $(DEF_CAP) $(DEF_IDN) $(DEF_WITHOUT_IFADDRS)
216 -+DEF_ping = $(DEF_CAP) $(DEF_IDN) $(DEF_WITHOUT_IFADDRS) $(DEF_IPV4)
217 - LIB_ping = $(LIB_CAP) $(LIB_IDN) $(LIB_RESOLV)
218 -
219 - ping: ping_common.o ping6_common.o
220 -diff --git a/ping.c b/ping.c
221 -index ec9708e..a08a03e 100644
222 ---- a/ping.c
223 -+++ b/ping.c
224 -@@ -439,6 +439,11 @@ main(int argc, char **argv)
225 -
226 - target = argv[argc-1];
227 -
228 -+#ifdef IPV4_DEFAULT
229 -+ if (hints.ai_family == AF_UNSPEC)
230 -+ hints.ai_family = AF_INET;
231 -+#endif
232 -+
233 - /* Create sockets */
234 - enable_capability_raw();
235 - if (hints.ai_family != AF_INET6)
236 ---
237 -2.5.0
238 -
239
240 diff --git a/net-misc/iputils/iputils-20150815-r1.ebuild b/net-misc/iputils/iputils-20150815-r1.ebuild
241 index a23f1b9..5227963 100644
242 --- a/net-misc/iputils/iputils-20150815-r1.ebuild
243 +++ b/net-misc/iputils/iputils-20150815-r1.ebuild
244 @@ -1,4 +1,4 @@
245 -# Copyright 1999-2015 Gentoo Foundation
246 +# Copyright 1999-2016 Gentoo Foundation
247 # Distributed under the terms of the GNU General Public License v2
248 # $Id$
249
250 @@ -7,7 +7,7 @@
251 # building stages, and when the jade/sgml packages are broken (which
252 # seems to be more common than would be nice).
253
254 -EAPI="4"
255 +EAPI=5
256
257 inherit flag-o-matic eutils toolchain-funcs fcaps
258 if [[ ${PV} == "99999999" ]] ; then
259 @@ -58,8 +58,8 @@ S=${WORKDIR}/${PN}-s${PV}
260
261 PATCHES=(
262 "${FILESDIR}/021109-uclibc-no-ether_ntohost.patch"
263 - "${FILESDIR}/${PN}-20150815-ping_default_ipv4.patch"
264 - "${FILESDIR}/${PN}-20150815-ping6_crypto.patch"
265 + "${FILESDIR}/${PN}-20150815-defines_and_libs.patch"
266 + "${FILESDIR}/${PN}-20150815-handle_single_protocol_system.patch"
267 )
268
269 src_prepare() {