diff options
Diffstat (limited to 'main/fping/musl-ipv6-icmp-workaround.patch')
-rw-r--r-- | main/fping/musl-ipv6-icmp-workaround.patch | 27 |
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?)" ); + } |