Gentoo Archives: gentoo-commits

From: Thomas Deutschmann <whissi@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: net-misc/iputils/files/, net-misc/iputils/
Date: Mon, 01 Oct 2018 18:00:45
Message-Id: 1538416817.7e5d313104a13e24ef704f176618dcb63dc87209.whissi@gentoo
1 commit: 7e5d313104a13e24ef704f176618dcb63dc87209
2 Author: Thomas Deutschmann <whissi <AT> gentoo <DOT> org>
3 AuthorDate: Mon Oct 1 18:00:17 2018 +0000
4 Commit: Thomas Deutschmann <whissi <AT> gentoo <DOT> org>
5 CommitDate: Mon Oct 1 18:00:17 2018 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=7e5d3131
7
8 net-misc/iputils: fix build on musl when USE=-idn
9
10 Closes: https://bugs.gentoo.org/665164
11 Signed-off-by: Thomas Deutschmann <whissi <AT> gentoo.org>
12 Package-Manager: Portage-2.3.50, Repoman-2.3.11
13
14 .../files/iputils-20180629-fix-ping-on-musl.patch | 54 ++++++++++++++++++++++
15 net-misc/iputils/iputils-20180629.ebuild | 3 +-
16 2 files changed, 56 insertions(+), 1 deletion(-)
17
18 diff --git a/net-misc/iputils/files/iputils-20180629-fix-ping-on-musl.patch b/net-misc/iputils/files/iputils-20180629-fix-ping-on-musl.patch
19 new file mode 100644
20 index 00000000000..8d8160a3d4a
21 --- /dev/null
22 +++ b/net-misc/iputils/files/iputils-20180629-fix-ping-on-musl.patch
23 @@ -0,0 +1,54 @@
24 +From 25899e849aa3abc1ad29ebf0b830262a859eaed5 Mon Sep 17 00:00:00 2001
25 +From: Petr Vorel <petr.vorel@×××××.com>
26 +Date: Sat, 21 Jul 2018 17:46:14 +0200
27 +Subject: [PATCH] ping: Fix AI_CANONIDN usage on some systems
28 +
29 +Commit 99f67db used AI_CANONIDN in a way, which broke compilation on
30 +systems where AI_CANONIDN is not defined in netdb.h (e.g. glibc < 2.3.4,
31 +alternative libcs that don't support IDN: e.g. current musl 1.1.19 and
32 +uClibc-ng 1.0.30) when not using the system libidn2.
33 +
34 +Fixes: 99f67db ping: Fix ping name encoded using ACE on C locale
35 +
36 +Reported-by: Nicholas Fish
37 +Signed-off-by: Petr Vorel <petr.vorel@×××××.com>
38 +---
39 + ping.c | 2 +-
40 + ping.h | 2 +-
41 + 2 files changed, 2 insertions(+), 2 deletions(-)
42 +
43 +diff --git a/ping.c b/ping.c
44 +index 733477f..b241815 100644
45 +--- a/ping.c
46 ++++ b/ping.c
47 +@@ -207,9 +207,9 @@ main(int argc, char **argv)
48 +
49 + #ifdef USE_IDN
50 + setlocale(LC_ALL, "");
51 +-#endif
52 + if (!strcmp(setlocale(LC_ALL, NULL), "C"))
53 + hints.ai_flags &= ~ AI_CANONIDN;
54 ++#endif
55 +
56 + /* Support being called using `ping4` or `ping6` symlinks */
57 + if (argv[0][strlen(argv[0])-1] == '4')
58 +diff --git a/ping.h b/ping.h
59 +index 3e09685..8a0c4ef 100644
60 +--- a/ping.h
61 ++++ b/ping.h
62 +@@ -28,7 +28,6 @@
63 + #include <netinet/icmp6.h>
64 + #include <linux/filter.h>
65 + #include <resolv.h>
66 +-#include <locale.h>
67 +
68 + #ifdef CAPABILITIES
69 + #include <sys/prctl.h>
70 +@@ -36,6 +35,7 @@
71 + #endif
72 +
73 + #ifdef USE_IDN
74 ++#include <locale.h>
75 + #include <idn2.h>
76 + #define getaddrinfo_flags (AI_CANONNAME | AI_IDN | AI_CANONIDN)
77 + #define getnameinfo_flags NI_IDN
78
79 diff --git a/net-misc/iputils/iputils-20180629.ebuild b/net-misc/iputils/iputils-20180629.ebuild
80 index fb577b0efbb..98e13d04e31 100644
81 --- a/net-misc/iputils/iputils-20180629.ebuild
82 +++ b/net-misc/iputils/iputils-20180629.ebuild
83 @@ -1,4 +1,4 @@
84 -# Copyright 1999-2018 Gentoo Foundation
85 +# Copyright 1999-2018 Gentoo Authors
86 # Distributed under the terms of the GNU General Public License v2
87
88 # For released versions, we precompile the man/html pages and store
89 @@ -15,6 +15,7 @@ MY_PV="${PV/_pre/}"
90
91 PATCHES=(
92 "${FILESDIR}"/${PN}-20180629-musl.patch
93 + "${FILESDIR}"/${P}-fix-ping-on-musl.patch
94 )
95
96 if [[ ${PV} == "99999999" ]] ; then