diff options
author | Francesco Colista <fcolista@alpinelinux.org> | 2014-04-15 09:53:51 +0000 |
---|---|---|
committer | Francesco Colista <fcolista@alpinelinux.org> | 2014-04-15 10:47:40 +0000 |
commit | 886cdb13df9d53858fead63397547357770eb638 (patch) | |
tree | e7c16624b276727775cc39c39dc84fdc35134cf5 | |
parent | 0a7a893f64cb0bddefb5a7ca2593fd95bbf43e7b (diff) | |
download | alpine_aports-886cdb13df9d53858fead63397547357770eb638.tar.bz2 alpine_aports-886cdb13df9d53858fead63397547357770eb638.tar.xz alpine_aports-886cdb13df9d53858fead63397547357770eb638.zip |
main/iputils: fixes compilation with musl
9 files changed, 536 insertions, 5 deletions
diff --git a/main/iputils/APKBUILD b/main/iputils/APKBUILD index 933168b072..bc6e43036a 100644 --- a/main/iputils/APKBUILD +++ b/main/iputils/APKBUILD | |||
@@ -1,7 +1,7 @@ | |||
1 | # Maintainer: Natanael Copa <ncopa@alpinelinux.org> | 1 | # Maintainer: Natanael Copa <ncopa@alpinelinux.org> |
2 | pkgname=iputils | 2 | pkgname=iputils |
3 | pkgver=20121221 | 3 | pkgver=20121221 |
4 | pkgrel=1 | 4 | pkgrel=2 |
5 | pkgdesc="IP Configuration Utilities (and Ping)" | 5 | pkgdesc="IP Configuration Utilities (and Ping)" |
6 | url="http://www.linuxfoundation.org/en/Net:Iputils" | 6 | url="http://www.linuxfoundation.org/en/Net:Iputils" |
7 | arch="all" | 7 | arch="all" |
@@ -10,9 +10,28 @@ install="" | |||
10 | depends="" | 10 | depends="" |
11 | makedepends="libcap-dev openssl-dev" | 11 | makedepends="libcap-dev openssl-dev" |
12 | replaces="bbsuid" | 12 | replaces="bbsuid" |
13 | source="http://www.skbuff.net/$pkgname/$pkgname-s$pkgver.tar.bz2" | 13 | source="http://www.skbuff.net/$pkgname/$pkgname-s$pkgver.tar.bz2 |
14 | net-misc_iputils_files_iputils-20121221-add-bits_types_h.patch | ||
15 | net-misc_iputils_files_iputils-20121221-crypto-build.patch | ||
16 | net-misc_iputils_files_iputils-20121221-fix-init-elemnt.patch | ||
17 | net-misc_iputils_files_iputils-20121221-fix-musl-headers.patch | ||
18 | net-misc_iputils_files_iputils-20121221-makefile.patch | ||
19 | net-misc_iputils_files_iputils-20121221-openssl.patch | ||
20 | net-misc_iputils_files_iputils-20121221-printf-size.patch | ||
21 | net-misc_iputils_files_iputils-20121221-remove-rdisc-glibc-assumption.patch" | ||
14 | 22 | ||
15 | _builddir="$srcdir"/$pkgname-s$pkgver | 23 | _builddir="$srcdir"/$pkgname-s$pkgver |
24 | |||
25 | prepare() { | ||
26 | local i | ||
27 | cd "$_builddir" | ||
28 | for i in $source; do | ||
29 | case $i in | ||
30 | *.patch) msg $i; patch -p1 -i "$srcdir"/$i || return 1;; | ||
31 | esac | ||
32 | done | ||
33 | } | ||
34 | |||
16 | build() { | 35 | build() { |
17 | cd "$_builddir" | 36 | cd "$_builddir" |
18 | make USE_GNUTLS=no KERNEL_INCLUDE=/usr/include || return 1 | 37 | make USE_GNUTLS=no KERNEL_INCLUDE=/usr/include || return 1 |
@@ -28,6 +47,30 @@ package() { | |||
28 | done | 47 | done |
29 | } | 48 | } |
30 | 49 | ||
31 | md5sums="6072aef64205720dd1893b375e184171 iputils-s20121221.tar.bz2" | 50 | md5sums="6072aef64205720dd1893b375e184171 iputils-s20121221.tar.bz2 |
32 | sha256sums="450f549fc5b620c23c5929aa6d54b7ddfc7ee1cb1e8efdc5e8bb21d8d0c5319f iputils-s20121221.tar.bz2" | 51 | 2b31520b0d939e0b82e6a6a3bba0dfcc net-misc_iputils_files_iputils-20121221-add-bits_types_h.patch |
33 | sha512sums="693d240becd766c345c3af2053fc0699b9358e54d667d40738c21d731b70e779112d81476a220d8300ca54250120385414a13610d445996f95a90571047389f4 iputils-s20121221.tar.bz2" | 52 | 8ea6b0b6f2598fadfb0e505998c554de net-misc_iputils_files_iputils-20121221-crypto-build.patch |
53 | 1cb3cb8c34e3a20e3722393aa61c1869 net-misc_iputils_files_iputils-20121221-fix-init-elemnt.patch | ||
54 | c47ac7ec21ba9bcaa0311c692ccd14d6 net-misc_iputils_files_iputils-20121221-fix-musl-headers.patch | ||
55 | c1e5dab42e18b35a00ed7b3755c24e4e net-misc_iputils_files_iputils-20121221-makefile.patch | ||
56 | 1c6c476e3b4850754a2cd91fd53f0cfd net-misc_iputils_files_iputils-20121221-openssl.patch | ||
57 | 4c35d6b1d9c0727b9647860a5334ae0f net-misc_iputils_files_iputils-20121221-printf-size.patch | ||
58 | d4b0a95e52532070a8b45fba46112f66 net-misc_iputils_files_iputils-20121221-remove-rdisc-glibc-assumption.patch" | ||
59 | sha256sums="450f549fc5b620c23c5929aa6d54b7ddfc7ee1cb1e8efdc5e8bb21d8d0c5319f iputils-s20121221.tar.bz2 | ||
60 | e198400f387fa4140c7c6a75089b570ea24d044cf6fd55b1f37f239bb018969e net-misc_iputils_files_iputils-20121221-add-bits_types_h.patch | ||
61 | cafc281c70d46f2964489b4c19c981bcf203b4c6266d4f49437c3fe67e2027b2 net-misc_iputils_files_iputils-20121221-crypto-build.patch | ||
62 | 302b1118596befdad56d23769e36fc0960d807230bc5c6ad4ad59d00fb78560b net-misc_iputils_files_iputils-20121221-fix-init-elemnt.patch | ||
63 | bdd3992ed19d625cfd08563ef46ab22f25ca46390ad4603e501f9c66d2508bcc net-misc_iputils_files_iputils-20121221-fix-musl-headers.patch | ||
64 | 779632822e3440f3b898a50955cb8fb72177f0d1623c9da7c0a8afa68313435f net-misc_iputils_files_iputils-20121221-makefile.patch | ||
65 | cc1af5ccdd593b4fa43273cf7de8b9552f0a5d33a72a35fcc4f94cf2c6fc9a44 net-misc_iputils_files_iputils-20121221-openssl.patch | ||
66 | a1ed939d0e008bca06208ae34e3f17a0ddc66b50f1679f82a630b52cdfbd111a net-misc_iputils_files_iputils-20121221-printf-size.patch | ||
67 | 0639fca129c3e2ca57a7e0f0d3392474665e11f139cfa9362a365b3fca9593b2 net-misc_iputils_files_iputils-20121221-remove-rdisc-glibc-assumption.patch" | ||
68 | sha512sums="693d240becd766c345c3af2053fc0699b9358e54d667d40738c21d731b70e779112d81476a220d8300ca54250120385414a13610d445996f95a90571047389f4 iputils-s20121221.tar.bz2 | ||
69 | 666c1711c5a5c829246a0f9a3d9afbb0ceb43e172b907230b856dbc0a330814d0c562e1894ee3b6051c01b54469fafd429c4236954967691b12744cacc844dab net-misc_iputils_files_iputils-20121221-add-bits_types_h.patch | ||
70 | 922daa01f00c19f8237515b2d3ab73b87daa957cfc491382def2ce1c098ffed943ad4952c94134f3155570f64353abf5348523ea773ce7eb457578f975cc92d2 net-misc_iputils_files_iputils-20121221-crypto-build.patch | ||
71 | 15cc4a96851eaa77f08e3914139925cecc50ff7161a693e86cb6f5ae09da5c2d232325f922c1cf4af20d639ed89071314092f31fa55e23bc5033bfb74eeda7a3 net-misc_iputils_files_iputils-20121221-fix-init-elemnt.patch | ||
72 | 82b88635e5fec34b4175c74d25b821d3b76b899c48aa87b7035ae8702a3ede3abaebb3d9be32cb7e853186d78db5e9c03cdd14cfc1ce9481f6ae65466815bdac net-misc_iputils_files_iputils-20121221-fix-musl-headers.patch | ||
73 | 5899942b73d4d13e0ff85f22a81e9107b2a04c82cac6b59559a521c5d0bf25007e34b61b2dfdb40c21b221a108f6ba72c1a51fa59359a400ad045c9394c176db net-misc_iputils_files_iputils-20121221-makefile.patch | ||
74 | 05240c00d0a1f9f878a9826d54cbd0128c2ed5ce7cab4685907956156c3cf2131ccd563812b64490bf915a75f52851396966a590027fc4c1886b2d19f421718b net-misc_iputils_files_iputils-20121221-openssl.patch | ||
75 | ff5491ad5a0396bee41fcbfc1384699d396c24da093bd2209dead67f52efcec462dbfb4a43008083742d0139da7bd52e922499b5f7eae028384c74930453dd33 net-misc_iputils_files_iputils-20121221-printf-size.patch | ||
76 | 2ed65a0c0188cf6e06bfb5e3795fa720f7e7040533adbc1ce0c5ded435b823792790890826fc4250a6b2fba16576dc024c50d1faf9598f2fe36aadda77db8a36 net-misc_iputils_files_iputils-20121221-remove-rdisc-glibc-assumption.patch" | ||
diff --git a/main/iputils/net-misc_iputils_files_iputils-20121221-add-bits_types_h.patch b/main/iputils/net-misc_iputils_files_iputils-20121221-add-bits_types_h.patch new file mode 100644 index 0000000000..9ea341895d --- /dev/null +++ b/main/iputils/net-misc_iputils_files_iputils-20121221-add-bits_types_h.patch | |||
@@ -0,0 +1,94 @@ | |||
1 | diff -Naur iputils-s20121221.orig/clockdiff.c iputils-s20121221/clockdiff.c | ||
2 | --- iputils-s20121221.orig/clockdiff.c 2014-01-24 15:32:49.111934548 +0000 | ||
3 | +++ iputils-s20121221/clockdiff.c 2014-01-24 15:32:14.438932610 +0000 | ||
4 | @@ -23,6 +23,8 @@ | ||
5 | #include <sys/capability.h> | ||
6 | #endif | ||
7 | |||
8 | +#include "types.h" | ||
9 | + | ||
10 | void usage(void) __attribute__((noreturn)); | ||
11 | |||
12 | #define MAX_HOSTNAMELEN NI_MAXHOST | ||
13 | diff -Naur iputils-s20121221.orig/ping.c iputils-s20121221/ping.c | ||
14 | --- iputils-s20121221.orig/ping.c 2014-01-24 15:32:49.111934548 +0000 | ||
15 | +++ iputils-s20121221/ping.c 2014-01-24 15:32:14.459932611 +0000 | ||
16 | @@ -59,6 +59,7 @@ | ||
17 | */ | ||
18 | |||
19 | #include "ping_common.h" | ||
20 | +#include "types.h" | ||
21 | |||
22 | #include <netinet/ip.h> | ||
23 | #include <netinet/ip_icmp.h> | ||
24 | diff -Naur iputils-s20121221.orig/ping6.c iputils-s20121221/ping6.c | ||
25 | --- iputils-s20121221.orig/ping6.c 2014-01-24 15:32:49.112934549 +0000 | ||
26 | +++ iputils-s20121221/ping6.c 2014-01-24 15:32:14.439932610 +0000 | ||
27 | @@ -67,6 +67,7 @@ | ||
28 | * This program has to run SUID to ROOT to access the ICMP socket. | ||
29 | */ | ||
30 | #include "ping_common.h" | ||
31 | +#include "types.h" | ||
32 | |||
33 | #include <linux/filter.h> | ||
34 | #include <netinet/ip6.h> | ||
35 | diff -Naur iputils-s20121221.orig/ping_common.c iputils-s20121221/ping_common.c | ||
36 | --- iputils-s20121221.orig/ping_common.c 2014-01-24 15:32:49.112934549 +0000 | ||
37 | +++ iputils-s20121221/ping_common.c 2014-01-24 15:32:14.439932610 +0000 | ||
38 | @@ -1,4 +1,5 @@ | ||
39 | #include "ping_common.h" | ||
40 | +#include "types.h" | ||
41 | #include <ctype.h> | ||
42 | #include <sched.h> | ||
43 | #include <math.h> | ||
44 | diff -Naur iputils-s20121221.orig/ping_common.h iputils-s20121221/ping_common.h | ||
45 | --- iputils-s20121221.orig/ping_common.h 2014-01-24 15:32:14.419932609 +0000 | ||
46 | +++ iputils-s20121221/ping_common.h 2014-01-24 15:33:08.206935616 +0000 | ||
47 | @@ -35,6 +35,7 @@ | ||
48 | #include <linux/errqueue.h> | ||
49 | |||
50 | #include "SNAPSHOT.h" | ||
51 | +#include "types.h" | ||
52 | |||
53 | #define DEFDATALEN (64 - 8) /* default data length */ | ||
54 | |||
55 | diff -Naur iputils-s20121221.orig/rdisc.c iputils-s20121221/rdisc.c | ||
56 | --- iputils-s20121221.orig/rdisc.c 2014-01-24 15:32:49.113934549 +0000 | ||
57 | +++ iputils-s20121221/rdisc.c 2014-01-24 15:32:14.450932610 +0000 | ||
58 | @@ -62,6 +62,7 @@ | ||
59 | #include <syslog.h> | ||
60 | |||
61 | #include "SNAPSHOT.h" | ||
62 | +#include "types.h" | ||
63 | |||
64 | struct interface | ||
65 | { | ||
66 | diff -Naur iputils-s20121221.orig/traceroute6.c iputils-s20121221/traceroute6.c | ||
67 | --- iputils-s20121221.orig/traceroute6.c 2014-01-24 15:32:49.113934549 +0000 | ||
68 | +++ iputils-s20121221/traceroute6.c 2014-01-24 15:32:14.440932610 +0000 | ||
69 | @@ -267,6 +267,7 @@ | ||
70 | #include <string.h> | ||
71 | #include <unistd.h> | ||
72 | |||
73 | +#include "types.h" | ||
74 | #include "SNAPSHOT.h" | ||
75 | |||
76 | #ifndef SOL_IPV6 | ||
77 | diff -Naur iputils-s20121221.orig/types.h iputils-s20121221/types.h | ||
78 | --- iputils-s20121221.orig/types.h 1970-01-01 00:00:00.000000000 +0000 | ||
79 | +++ iputils-s20121221/types.h 2014-01-24 15:32:14.440932610 +0000 | ||
80 | @@ -0,0 +1,14 @@ | ||
81 | +/* This is a small version of <bits/types.h> from glibc | ||
82 | + * to take care of type u_char. | ||
83 | + * | ||
84 | + * Anthony G. Basile <blueness@gentoo.org> | ||
85 | + */ | ||
86 | +#ifndef _BITS_TYPES_H | ||
87 | +#define _BITS_TYPES_H 1 | ||
88 | + | ||
89 | +typedef unsigned char u_char; | ||
90 | +typedef unsigned short int u_short; | ||
91 | +typedef unsigned int u_int; | ||
92 | +typedef unsigned long int u_long; | ||
93 | + | ||
94 | +#endif /* mini <bits/types.h> */ | ||
diff --git a/main/iputils/net-misc_iputils_files_iputils-20121221-crypto-build.patch b/main/iputils/net-misc_iputils_files_iputils-20121221-crypto-build.patch new file mode 100644 index 0000000000..1ec3c101d5 --- /dev/null +++ b/main/iputils/net-misc_iputils_files_iputils-20121221-crypto-build.patch | |||
@@ -0,0 +1,35 @@ | |||
1 | From 568e990d30fc7e9416e0a6f8c74ea5013921eaec Mon Sep 17 00:00:00 2001 | ||
2 | From: Arjan van de Ven <arjanvandeven@gmail.com> | ||
3 | Date: Wed, 16 Jan 2013 03:12:15 +0900 | ||
4 | Subject: [PATCH [iputils]] ping6: Fix build command line argument with gnutls. | ||
5 | |||
6 | The ping6 command can use either openssl or gnutls... | ||
7 | and the Makefile has a bunch of setup for defining which of the two to use. | ||
8 | |||
9 | Unfortunately, the final -D define on the commandline to enable gnutls | ||
10 | inside the ping6.c file didn't actually make it onto the gcc | ||
11 | commandline. | ||
12 | This patch adds the $(DEF_CRYPTO) Makefile variable to fix this gap. | ||
13 | |||
14 | Signed-off-by: Arjan van de Ven <arjanvandeven@gmail.com> | ||
15 | Signed-off-by: YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org> | ||
16 | --- | ||
17 | Makefile | 2 +- | ||
18 | 1 file changed, 1 insertion(+), 1 deletion(-) | ||
19 | |||
20 | diff --git a/Makefile b/Makefile | ||
21 | index c62d9df..89249f5 100644 | ||
22 | --- a/Makefile | ||
23 | +++ b/Makefile | ||
24 | @@ -149,7 +149,7 @@ LIB_clockdiff = $(LIB_CAP) | ||
25 | DEF_ping_common = $(DEF_CAP) $(DEF_IDN) | ||
26 | DEF_ping = $(DEF_CAP) $(DEF_IDN) $(DEF_WITHOUT_IFADDRS) | ||
27 | LIB_ping = $(LIB_CAP) $(LIB_IDN) | ||
28 | -DEF_ping6 = $(DEF_CAP) $(DEF_IDN) $(DEF_WITHOUT_IFADDRS) $(DEF_ENABLE_PING6_RTHDR) | ||
29 | +DEF_ping6 = $(DEF_CAP) $(DEF_IDN) $(DEF_WITHOUT_IFADDRS) $(DEF_ENABLE_PING6_RTHDR) $(DEF_CRYPTO) | ||
30 | LIB_ping6 = $(LIB_CAP) $(LIB_IDN) $(LIB_RESOLV) $(LIB_CRYPTO) | ||
31 | |||
32 | ping: ping_common.o | ||
33 | -- | ||
34 | 1.8.0.2 | ||
35 | |||
diff --git a/main/iputils/net-misc_iputils_files_iputils-20121221-fix-init-elemnt.patch b/main/iputils/net-misc_iputils_files_iputils-20121221-fix-init-elemnt.patch new file mode 100644 index 0000000000..554ce9bd9b --- /dev/null +++ b/main/iputils/net-misc_iputils_files_iputils-20121221-fix-init-elemnt.patch | |||
@@ -0,0 +1,23 @@ | |||
1 | diff -Naur iputils-s20121221.orig/ping.c iputils-s20121221/ping.c | ||
2 | --- iputils-s20121221.orig/ping.c 2014-01-24 15:05:02.082841335 +0000 | ||
3 | +++ iputils-s20121221/ping.c 2014-01-24 15:17:12.975882203 +0000 | ||
4 | @@ -774,9 +774,16 @@ | ||
5 | |||
6 | do { | ||
7 | static struct iovec iov = {outpack, 0}; | ||
8 | - static struct msghdr m = { &whereto, sizeof(whereto), | ||
9 | - &iov, 1, &cmsg, 0, 0 }; | ||
10 | - m.msg_controllen = cmsg_len; | ||
11 | + static struct msghdr m; | ||
12 | + | ||
13 | + m.msg_name = &whereto; | ||
14 | + m.msg_namelen = sizeof(whereto); | ||
15 | + m.msg_iov = &iov; | ||
16 | + m.msg_iovlen = 1; | ||
17 | + m.msg_control = &cmsg; | ||
18 | + m.msg_controllen = sizeof(cmsg); | ||
19 | + m.msg_flags = 0; | ||
20 | + | ||
21 | iov.iov_len = cc; | ||
22 | |||
23 | i = sendmsg(icmp_sock, &m, confirm); | ||
diff --git a/main/iputils/net-misc_iputils_files_iputils-20121221-fix-musl-headers.patch b/main/iputils/net-misc_iputils_files_iputils-20121221-fix-musl-headers.patch new file mode 100644 index 0000000000..d12dd828c1 --- /dev/null +++ b/main/iputils/net-misc_iputils_files_iputils-20121221-fix-musl-headers.patch | |||
@@ -0,0 +1,89 @@ | |||
1 | diff -Naur iputils-s20121221.orig/arping.c iputils-s20121221/arping.c | ||
2 | --- iputils-s20121221.orig/arping.c 2012-12-21 14:01:07.000000000 +0000 | ||
3 | +++ iputils-s20121221/arping.c 2014-01-23 21:19:57.091268011 +0000 | ||
4 | @@ -16,7 +16,7 @@ | ||
5 | #include <linux/sockios.h> | ||
6 | #include <sys/file.h> | ||
7 | #include <sys/time.h> | ||
8 | -#include <sys/signal.h> | ||
9 | +#include <signal.h> | ||
10 | #include <sys/ioctl.h> | ||
11 | #include <net/if.h> | ||
12 | #include <linux/if_packet.h> | ||
13 | --- iputils-s20121221.orig/clockdiff.c 2012-12-21 14:01:07.000000000 +0000 | ||
14 | +++ iputils-s20121221/clockdiff.c 2014-01-23 21:19:57.093268011 +0000 | ||
15 | @@ -14,7 +14,6 @@ | ||
16 | #include <netinet/ip.h> | ||
17 | #include <netinet/ip_icmp.h> | ||
18 | #define TSPTYPES | ||
19 | -#include <protocols/timed.h> | ||
20 | #include <fcntl.h> | ||
21 | #include <netdb.h> | ||
22 | #include <arpa/inet.h> | ||
23 | diff -Naur iputils-s20121221.orig/ping_common.h iputils-s20121221/ping_common.h | ||
24 | --- iputils-s20121221.orig/ping_common.h 2012-12-21 14:01:07.000000000 +0000 | ||
25 | +++ iputils-s20121221/ping_common.h 2014-01-23 21:27:07.677292088 +0000 | ||
26 | @@ -7,16 +7,17 @@ | ||
27 | #include <linux/sockios.h> | ||
28 | #include <sys/file.h> | ||
29 | #include <sys/time.h> | ||
30 | -#include <sys/signal.h> | ||
31 | +#include <signal.h> | ||
32 | #include <sys/ioctl.h> | ||
33 | #include <net/if.h> | ||
34 | #include <sys/uio.h> | ||
35 | -#include <sys/poll.h> | ||
36 | +#include <poll.h> | ||
37 | #include <ctype.h> | ||
38 | #include <errno.h> | ||
39 | #include <string.h> | ||
40 | #include <netdb.h> | ||
41 | #include <setjmp.h> | ||
42 | +#include <asm-generic/param.h> | ||
43 | |||
44 | #ifdef CAPABILITIES | ||
45 | #include <sys/prctl.h> | ||
46 | --- iputils-s20121221.orig/rarpd.c 2014-01-24 13:38:46.816551953 +0000 | ||
47 | +++ iputils-s20121221/rarpd.c 2014-01-24 13:36:51.833545524 +0000 | ||
48 | @@ -19,16 +19,17 @@ | ||
49 | #include <netdb.h> | ||
50 | #include <arpa/inet.h> | ||
51 | #include <sys/ioctl.h> | ||
52 | -#include <sys/poll.h> | ||
53 | -#include <sys/errno.h> | ||
54 | -#include <sys/fcntl.h> | ||
55 | +#include <poll.h> | ||
56 | +#include <errno.h> | ||
57 | +#include <fcntl.h> | ||
58 | #include <sys/socket.h> | ||
59 | -#include <sys/signal.h> | ||
60 | +#include <signal.h> | ||
61 | #include <linux/if.h> | ||
62 | #include <linux/if_arp.h> | ||
63 | #include <netinet/in.h> | ||
64 | #include <linux/if_packet.h> | ||
65 | #include <linux/filter.h> | ||
66 | +#include <sys/types.h> | ||
67 | |||
68 | int do_reload = 1; | ||
69 | |||
70 | --- iputils-s20121221.orig/tracepath.c 2014-01-24 13:38:46.865551956 +0000 | ||
71 | +++ iputils-s20121221/tracepath.c 2014-01-23 21:19:57.109268012 +0000 | ||
72 | @@ -23,6 +23,7 @@ | ||
73 | #include <sys/time.h> | ||
74 | #include <sys/uio.h> | ||
75 | #include <arpa/inet.h> | ||
76 | +#include <limits.h> | ||
77 | #ifdef USE_IDN | ||
78 | #include <idna.h> | ||
79 | #include <locale.h> | ||
80 | --- iputils-s20121221.orig/tracepath6.c 2014-01-24 13:38:46.865551956 +0000 | ||
81 | +++ iputils-s20121221/tracepath6.c 2014-01-23 21:20:40.316270428 +0000 | ||
82 | @@ -25,6 +25,7 @@ | ||
83 | #include <sys/time.h> | ||
84 | #include <sys/uio.h> | ||
85 | #include <arpa/inet.h> | ||
86 | +#include <limits.h> | ||
87 | |||
88 | #ifdef USE_IDN | ||
89 | #include <idna.h> | ||
diff --git a/main/iputils/net-misc_iputils_files_iputils-20121221-makefile.patch b/main/iputils/net-misc_iputils_files_iputils-20121221-makefile.patch new file mode 100644 index 0000000000..66424c85cf --- /dev/null +++ b/main/iputils/net-misc_iputils_files_iputils-20121221-makefile.patch | |||
@@ -0,0 +1,61 @@ | |||
1 | From c66609d2c830d6fe06f48f5d38c54eb5cc6f2975 Mon Sep 17 00:00:00 2001 | ||
2 | From: Mike Frysinger <vapier@gentoo.org> | ||
3 | Date: Thu, 24 Jan 2013 23:36:16 -0500 | ||
4 | Subject: [PATCH [iputils]] fix handling of CFLAGS | ||
5 | |||
6 | This defaults CFLAGS to -O3 without clobbering settings people have set | ||
7 | up in the environment already. | ||
8 | |||
9 | Signed-off-by: Mike Frysinger <vapier@gentoo.org> | ||
10 | --- | ||
11 | Makefile | 13 +++++-------- | ||
12 | 1 file changed, 5 insertions(+), 8 deletions(-) | ||
13 | |||
14 | diff --git a/Makefile b/Makefile | ||
15 | index 2c49940..ecabac3 100644 | ||
16 | --- a/Makefile | ||
17 | +++ b/Makefile | ||
18 | @@ -2,8 +2,6 @@ | ||
19 | # Configuration | ||
20 | # | ||
21 | |||
22 | -# CC | ||
23 | -CC=gcc | ||
24 | # Path to parent kernel include files directory | ||
25 | LIBC_INCLUDE=/usr/include | ||
26 | # Libraries | ||
27 | @@ -48,11 +46,10 @@ ENABLE_RDISC_SERVER=no | ||
28 | |||
29 | # ------------------------------------- | ||
30 | # What a pity, all new gccs are buggy and -Werror does not work. Sigh. | ||
31 | -# CCOPT=-fno-strict-aliasing -Wstrict-prototypes -Wall -Werror -g | ||
32 | -CCOPT=-fno-strict-aliasing -Wstrict-prototypes -Wall -g | ||
33 | -CCOPTOPT=-O3 | ||
34 | -GLIBCFIX=-D_GNU_SOURCE | ||
35 | -DEFINES= | ||
36 | +# CFLAGS+=-fno-strict-aliasing -Wstrict-prototypes -Wall -Werror -g | ||
37 | +CFLAGS?=-O3 -g | ||
38 | +CFLAGS+=-fno-strict-aliasing -Wstrict-prototypes -Wall | ||
39 | +CPPFLAGS+=-D_GNU_SOURCE | ||
40 | LDLIB= | ||
41 | |||
42 | FUNC_LIB = $(if $(filter static,$(1)),$(LDFLAG_STATIC) $(2) $(LDFLAG_DYNAMIC),$(2)) | ||
43 | @@ -113,7 +110,6 @@ IPV4_TARGETS=tracepath ping clockdiff rdisc arping tftpd rarpd | ||
44 | IPV6_TARGETS=tracepath6 traceroute6 ping6 | ||
45 | TARGETS=$(IPV4_TARGETS) $(IPV6_TARGETS) | ||
46 | |||
47 | -CFLAGS=$(CCOPTOPT) $(CCOPT) $(GLIBCFIX) $(DEFINES) | ||
48 | LDLIBS=$(LDLIB) $(ADDLIB) | ||
49 | |||
50 | UNAME_N:=$(shell uname -n) | ||
51 | @@ -132,6 +128,7 @@ all: $(TARGETS) | ||
52 | $(COMPILE.c) $< $(DEF_$(patsubst %.o,%,$@)) -S -o $@ | ||
53 | %.o: %.c | ||
54 | $(COMPILE.c) $< $(DEF_$(patsubst %.o,%,$@)) -o $@ | ||
55 | +LINK.o += $(CFLAGS) | ||
56 | $(TARGETS): %: %.o | ||
57 | $(LINK.o) $^ $(LIB_$@) $(LDLIBS) -o $@ | ||
58 | |||
59 | -- | ||
60 | 1.8.0.2 | ||
61 | |||
diff --git a/main/iputils/net-misc_iputils_files_iputils-20121221-openssl.patch b/main/iputils/net-misc_iputils_files_iputils-20121221-openssl.patch new file mode 100644 index 0000000000..1c6ba81dab --- /dev/null +++ b/main/iputils/net-misc_iputils_files_iputils-20121221-openssl.patch | |||
@@ -0,0 +1,92 @@ | |||
1 | From b57d77dcfa5cb363b7eba5b331324669a8505ac4 Mon Sep 17 00:00:00 2001 | ||
2 | From: Mike Frysinger <vapier@gentoo.org> | ||
3 | Date: Thu, 24 Jan 2013 23:32:39 -0500 | ||
4 | Subject: [PATCH [iputils]] ping6: allow disabling of openssl support | ||
5 | |||
6 | Signed-off-by: Mike Frysinger <vapier@gentoo.org> | ||
7 | --- | ||
8 | Makefile | 5 ++++- | ||
9 | ping6.c | 14 +++++++++++++- | ||
10 | 2 files changed, 17 insertions(+), 2 deletions(-) | ||
11 | |||
12 | diff --git a/Makefile b/Makefile | ||
13 | index 89249f5..2c49940 100644 | ||
14 | --- a/Makefile | ||
15 | +++ b/Makefile | ||
16 | @@ -36,7 +36,7 @@ ARPING_DEFAULT_DEVICE= | ||
17 | |||
18 | # GNU TLS library for ping6 [yes|no|static] | ||
19 | USE_GNUTLS=yes | ||
20 | -# Crypto library for ping6 [shared|static] | ||
21 | +# Crypto library for ping6 [shared|static|no] | ||
22 | USE_CRYPTO=shared | ||
23 | # Resolv library for ping6 [yes|static] | ||
24 | USE_RESOLV=yes | ||
25 | @@ -63,7 +63,10 @@ ifneq ($(USE_GNUTLS),no) | ||
26 | LIB_CRYPTO = $(call FUNC_LIB,$(USE_GNUTLS),$(LDFLAG_GNUTLS)) | ||
27 | DEF_CRYPTO = -DUSE_GNUTLS | ||
28 | else | ||
29 | +ifneq ($(USE_CRYPTO),no) | ||
30 | LIB_CRYPTO = $(call FUNC_LIB,$(USE_CRYPTO),$(LDFLAG_CRYPTO)) | ||
31 | + DEF_CRYPTO = -DUSE_OPENSSL | ||
32 | +endif | ||
33 | endif | ||
34 | |||
35 | # USE_RESOLV: LIB_RESOLV | ||
36 | diff --git a/ping6.c b/ping6.c | ||
37 | index c39864d..f2f90af 100644 | ||
38 | --- a/ping6.c | ||
39 | +++ b/ping6.c | ||
40 | @@ -168,8 +168,10 @@ static int icmp_sock; | ||
41 | |||
42 | #ifdef USE_GNUTLS | ||
43 | # include <gnutls/openssl.h> | ||
44 | -#else | ||
45 | +# define USE_CRYPTO | ||
46 | +#elif defined USE_OPENSSL | ||
47 | # include <openssl/md5.h> | ||
48 | +# define USE_CRYPTO | ||
49 | #endif | ||
50 | |||
51 | /* Node Information query */ | ||
52 | @@ -326,6 +328,7 @@ static void niquery_init_nonce(void) | ||
53 | #if !PING6_NONCE_MEMORY | ||
54 | static int niquery_nonce(__u8 *nonce, int fill) | ||
55 | { | ||
56 | +# ifdef USE_CRYPTO | ||
57 | static __u8 digest[MD5_DIGEST_LENGTH]; | ||
58 | static int seq = -1; | ||
59 | |||
60 | @@ -348,6 +351,10 @@ static int niquery_nonce(__u8 *nonce, int fill) | ||
61 | return -1; | ||
62 | return ntohsp((__u16 *)nonce); | ||
63 | } | ||
64 | +# else | ||
65 | + fprintf(stderr, "ping6: function not available; crypto disabled\n"); | ||
66 | + exit(3); | ||
67 | +# endif | ||
68 | } | ||
69 | #endif | ||
70 | |||
71 | @@ -502,6 +509,7 @@ static int niquery_option_subject_addr_handler(int index, const char *arg) | ||
72 | |||
73 | static int niquery_option_subject_name_handler(int index, const char *arg) | ||
74 | { | ||
75 | +#ifdef USE_CRYPTO | ||
76 | static char nigroup_buf[INET6_ADDRSTRLEN + 1 + IFNAMSIZ]; | ||
77 | unsigned char *dnptrs[2], **dpp, **lastdnptr; | ||
78 | int n; | ||
79 | @@ -627,6 +635,10 @@ errexit: | ||
80 | free(idn); | ||
81 | free(name); | ||
82 | exit(1); | ||
83 | +#else | ||
84 | + fprintf(stderr, "ping6: function not available; crypto disabled\n"); | ||
85 | + exit(3); | ||
86 | +#endif | ||
87 | } | ||
88 | |||
89 | int niquery_option_help_handler(int index, const char *arg) | ||
90 | -- | ||
91 | 1.8.0.2 | ||
92 | |||
diff --git a/main/iputils/net-misc_iputils_files_iputils-20121221-printf-size.patch b/main/iputils/net-misc_iputils_files_iputils-20121221-printf-size.patch new file mode 100644 index 0000000000..6d6c3b7d25 --- /dev/null +++ b/main/iputils/net-misc_iputils_files_iputils-20121221-printf-size.patch | |||
@@ -0,0 +1,64 @@ | |||
1 | From 23fcb10ae15a96aa9e5a823cfe0b612d9522691c Mon Sep 17 00:00:00 2001 | ||
2 | From: Mike Frysinger <vapier@gentoo.org> | ||
3 | Date: Sat, 14 Aug 2010 01:16:42 -0400 | ||
4 | Subject: [PATCH [iputils]] tracepath: re-use printf return in print_host | ||
5 | |||
6 | Since the printf funcs already return the length of chars displayed, | ||
7 | use that value instead of re-calculating the length with strlen. | ||
8 | |||
9 | This also fixes the handling of the strlen return -- it's a size_t, | ||
10 | not an int. | ||
11 | |||
12 | Signed-off-by: Mike Frysinger <vapier@gentoo.org> | ||
13 | --- | ||
14 | tracepath.c | 11 ++++------- | ||
15 | tracepath6.c | 11 ++++------- | ||
16 | 2 files changed, 8 insertions(+), 14 deletions(-) | ||
17 | |||
18 | diff --git a/tracepath.c b/tracepath.c | ||
19 | index 8a08f1d..f155816 100644 | ||
20 | --- a/tracepath.c | ||
21 | +++ b/tracepath.c | ||
22 | @@ -73,13 +73,10 @@ void data_wait(int fd) | ||
23 | |||
24 | void print_host(const char *a, const char *b, int both) | ||
25 | { | ||
26 | - int plen = 0; | ||
27 | - printf("%s", a); | ||
28 | - plen = strlen(a); | ||
29 | - if (both) { | ||
30 | - printf(" (%s)", b); | ||
31 | - plen += strlen(b) + 3; | ||
32 | - } | ||
33 | + int plen; | ||
34 | + plen = printf("%s", a); | ||
35 | + if (both) | ||
36 | + plen += printf(" (%s)", b); | ||
37 | if (plen >= HOST_COLUMN_SIZE) | ||
38 | plen = HOST_COLUMN_SIZE - 1; | ||
39 | printf("%*s", HOST_COLUMN_SIZE - plen, ""); | ||
40 | diff --git a/tracepath6.c b/tracepath6.c | ||
41 | index 126fadf..bee95c3 100644 | ||
42 | --- a/tracepath6.c | ||
43 | +++ b/tracepath6.c | ||
44 | @@ -86,13 +86,10 @@ void data_wait(int fd) | ||
45 | |||
46 | void print_host(const char *a, const char *b, int both) | ||
47 | { | ||
48 | - int plen = 0; | ||
49 | - printf("%s", a); | ||
50 | - plen = strlen(a); | ||
51 | - if (both) { | ||
52 | - printf(" (%s)", b); | ||
53 | - plen += strlen(b) + 3; | ||
54 | - } | ||
55 | + int plen; | ||
56 | + plen = printf("%s", a); | ||
57 | + if (both) | ||
58 | + plen += printf(" (%s)", b); | ||
59 | if (plen >= HOST_COLUMN_SIZE) | ||
60 | plen = HOST_COLUMN_SIZE - 1; | ||
61 | printf("%*s", HOST_COLUMN_SIZE - plen, ""); | ||
62 | -- | ||
63 | 1.8.0.2 | ||
64 | |||
diff --git a/main/iputils/net-misc_iputils_files_iputils-20121221-remove-rdisc-glibc-assumption.patch b/main/iputils/net-misc_iputils_files_iputils-20121221-remove-rdisc-glibc-assumption.patch new file mode 100644 index 0000000000..08e764dde6 --- /dev/null +++ b/main/iputils/net-misc_iputils_files_iputils-20121221-remove-rdisc-glibc-assumption.patch | |||
@@ -0,0 +1,30 @@ | |||
1 | diff -Naur iputils-s20121221.orig/rdisc.c iputils-s20121221/rdisc.c | ||
2 | --- iputils-s20121221.orig/rdisc.c 2014-01-24 14:59:29.937822762 +0000 | ||
3 | +++ iputils-s20121221/rdisc.c 2014-01-23 21:25:58.760288234 +0000 | ||
4 | @@ -115,26 +114,7 @@ | ||
5 | |||
6 | #define MAXIFS 32 | ||
7 | |||
8 | -#if !defined(__GLIBC__) || __GLIBC__ < 2 | ||
9 | -/* For router advertisement */ | ||
10 | -struct icmp_ra | ||
11 | -{ | ||
12 | - u_char icmp_type; /* type of message, see below */ | ||
13 | - u_char icmp_code; /* type sub code */ | ||
14 | - u_short icmp_cksum; /* ones complement cksum of struct */ | ||
15 | - u_char icmp_num_addrs; | ||
16 | - u_char icmp_wpa; /* Words per address */ | ||
17 | - short icmp_lifetime; | ||
18 | -}; | ||
19 | - | ||
20 | -struct icmp_ra_addr | ||
21 | -{ | ||
22 | - __u32 ira_addr; | ||
23 | - __u32 ira_preference; | ||
24 | -}; | ||
25 | -#else | ||
26 | #define icmp_ra icmp | ||
27 | -#endif | ||
28 | |||
29 | /* Router constants */ | ||
30 | #define MAX_INITIAL_ADVERT_INTERVAL 16 | ||