aboutsummaryrefslogtreecommitdiffstats
path: root/main/fping/musl-ipv6-icmp-workaround.patch
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/musl-ipv6-icmp-workaround.patch
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/musl-ipv6-icmp-workaround.patch')
-rw-r--r--main/fping/musl-ipv6-icmp-workaround.patch27
1 files changed, 27 insertions, 0 deletions
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?)" );
+ }