aboutsummaryrefslogtreecommitdiffstats
path: root/main/fping
diff options
context:
space:
mode:
authorNatanael Copa <ncopa@alpinelinux.org>2015-02-02 10:45:38 +0100
committerNatanael Copa <ncopa@alpinelinux.org>2015-02-02 10:51:21 +0100
commit2abdc2eb07801022e8314da1b96378364a1d83f9 (patch)
tree66a683100ea85c824db9c6d7bb58633fe8573d0c /main/fping
parent1b61c469a9a44fb5d6643f116dc15eec478ce4b5 (diff)
downloadaports-2abdc2eb07801022e8314da1b96378364a1d83f9.tar.bz2
aports-2abdc2eb07801022e8314da1b96378364a1d83f9.tar.xz
main/fping: fix fping6
we add workarounds for a couple of issues in musl libc
Diffstat (limited to 'main/fping')
-rw-r--r--main/fping/APKBUILD24
-rw-r--r--main/fping/musl-getaddrinfo-workaround.patch13
-rw-r--r--main/fping/musl-ipv6-icmp-workaround.patch27
3 files changed, 59 insertions, 5 deletions
diff --git a/main/fping/APKBUILD b/main/fping/APKBUILD
index db8e4bc444..38cbe7aadd 100644
--- a/main/fping/APKBUILD
+++ b/main/fping/APKBUILD
@@ -1,19 +1,27 @@
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=fping
pkgver=3.10
-pkgrel=1
+pkgrel=2
pkgdesc="A utility to ping multiple hosts at once"
url="http://fping.org/"
arch="all"
license="BSD"
depends=""
subpackages="$pkgname-doc"
-source="http://fping.org/dist/fping-$pkgver.tar.gz"
+source="http://fping.org/dist/fping-$pkgver.tar.gz
+ musl-getaddrinfo-workaround.patch
+ musl-ipv6-icmp-workaround.patch
+ "
options="suid"
_builddir="$srcdir"/$pkgname-$pkgver
prepare() {
cd "$_builddir"
+ for i in $source; do
+ case $i in
+ *.patch) msg $i; patch -p1 -i "$srcdir"/$i || return 1;;
+ esac
+ done
}
build () {
@@ -34,6 +42,12 @@ package() {
chmod 4755 "$pkgdir"/usr/sbin/fping
}
-md5sums="6a0ddecb671df1d580d20c0dd1095773 fping-3.10.tar.gz"
-sha256sums="cd47e842f32fe6aa72369d8a0e3545f7c137bb019e66f47379dc70febad357d8 fping-3.10.tar.gz"
-sha512sums="64bf93c7dbfa2b8adc3344514b2e6e182f1e5950da08b042b8d4d5e4c94b2b8bdc3aaba804339d0461dd88e0efbdfc0bd914a10d22810da8138c9c45335f7047 fping-3.10.tar.gz"
+md5sums="6a0ddecb671df1d580d20c0dd1095773 fping-3.10.tar.gz
+7507bc4dca2e0e90137b02d97c032c8e musl-getaddrinfo-workaround.patch
+ef31bb9581ea624cdd0913d4f65a6dda musl-ipv6-icmp-workaround.patch"
+sha256sums="cd47e842f32fe6aa72369d8a0e3545f7c137bb019e66f47379dc70febad357d8 fping-3.10.tar.gz
+dad94189cb843b321755b558550f7a64dcdd7fd45db663dd1a86858568cec815 musl-getaddrinfo-workaround.patch
+76c0d27cbdef016590d5d1959652cc89dc3905b1cba0ca3f5a9743382144aa02 musl-ipv6-icmp-workaround.patch"
+sha512sums="64bf93c7dbfa2b8adc3344514b2e6e182f1e5950da08b042b8d4d5e4c94b2b8bdc3aaba804339d0461dd88e0efbdfc0bd914a10d22810da8138c9c45335f7047 fping-3.10.tar.gz
+487e903dc4c293c109324c739cdc481ff270023acd8c0c0c0aa5953e9e5752f896b3f5aa39bbcf7378a672c2174221fddb503c96deaad1944c1622762331d3c2 musl-getaddrinfo-workaround.patch
+cd9aa4e19a6e570cb6cedc6413bbd078a3f5299addaaf9cf83be7c29f1171ca6efc650dd2dd86e61096de595b7e1bd362150cd4269020e822fa1067ca614ced5 musl-ipv6-icmp-workaround.patch"
diff --git a/main/fping/musl-getaddrinfo-workaround.patch b/main/fping/musl-getaddrinfo-workaround.patch
new file mode 100644
index 0000000000..93ebd00ac0
--- /dev/null
+++ b/main/fping/musl-getaddrinfo-workaround.patch
@@ -0,0 +1,13 @@
+--- ./src/fping.c.orig 2015-02-02 10:39:46.413468146 -0100
++++ ./src/fping.c 2015-02-02 10:41:00.654442294 -0100
+@@ -2045,7 +2045,9 @@
+ bzero(&hints, sizeof(struct addrinfo));
+ hints.ai_flags = 0;
+ hints.ai_family = AF_INET6;
+- hints.ai_socktype = SOCK_RAW;
++ /* setting socket type confuses musl libc and we dont need it for name
++ resolution */
++ // hints.ai_socktype = SOCK_RAW;
+ hints.ai_protocol = IPPROTO_ICMPV6;
+ ret_ga = getaddrinfo(name, NULL, &hints, &res);
+ if (ret_ga) {
diff --git a/main/fping/musl-ipv6-icmp-workaround.patch b/main/fping/musl-ipv6-icmp-workaround.patch
new file mode 100644
index 0000000000..d19e996e46
--- /dev/null
+++ b/main/fping/musl-ipv6-icmp-workaround.patch
@@ -0,0 +1,27 @@
+--- ./src/socket6.c.orig 2015-02-02 09:46:48.588456281 -0100
++++ ./src/socket6.c 2015-02-02 09:54:59.444873165 -0100
+@@ -44,18 +44,18 @@
+ int open_ping_socket_ipv6()
+ {
+ struct protoent *proto;
+- int opton = 1;
++ int protonum = 58;
+ int s;
+
+ /* confirm that ICMP is available on this machine */
+- if( ( proto = getprotobyname( "ipv6-icmp" ) ) == NULL )
+- crash_and_burn( "icmp: unknown protocol" );
++ if( ( proto = getprotobyname( "ipv6-icmp" ) ) != NULL )
++ protonum = proto->p_proto;
+
+ /* create raw socket for ICMP calls (ping) */
+- s = socket( AF_INET6, SOCK_RAW, proto->p_proto );
++ s = socket( AF_INET6, SOCK_RAW, protonum );
+ if( s < 0 ) {
+- /* try non-privileged icmp (works on Mac OSX without privileges, for example) */
+- s = socket( AF_INET6, SOCK_DGRAM, proto->p_proto );
++ /* try non-privileged icmp (works on Ma OSX without privileges, for example) */
++ s = socket( AF_INET6, SOCK_DGRAM, protonum );
+ if( s < 0 ) {
+ errno_crash_and_burn( "can't create raw socket (must run as root?)" );
+ }