diff options
author | Fabien Villepinte <fabien.villepinte@gmail.com> | 2019-09-28 21:29:54 +0200 |
---|---|---|
committer | Nikita Popov <nikita.ppv@gmail.com> | 2019-09-30 17:51:41 +0200 |
commit | 0aa3acc6c420ef19a33ee80e65c4fb2f2ee128d0 (patch) | |
tree | 36221c1449522c7cbfb5426bf67374f1a59f54fb /ext/sockets | |
parent | 1f0ffece91f127f3f67d0738b279a712226a206b (diff) | |
download | php-git-0aa3acc6c420ef19a33ee80e65c4fb2f2ee128d0.tar.gz |
Fix borked SKIPIFs
Diffstat (limited to 'ext/sockets')
-rw-r--r-- | ext/sockets/tests/mcast_ipv4_send_error.phpt | 6 | ||||
-rw-r--r-- | ext/sockets/tests/mcast_ipv6_recv.phpt | 6 | ||||
-rw-r--r-- | ext/sockets/tests/mcast_ipv6_recv_limited.phpt | 6 | ||||
-rw-r--r-- | ext/sockets/tests/socket_export_stream-3.phpt | 2 | ||||
-rw-r--r-- | ext/sockets/tests/socket_import_stream-3.phpt | 2 |
5 files changed, 14 insertions, 8 deletions
diff --git a/ext/sockets/tests/mcast_ipv4_send_error.phpt b/ext/sockets/tests/mcast_ipv4_send_error.phpt index 0929c79bdd..91063f4253 100644 --- a/ext/sockets/tests/mcast_ipv4_send_error.phpt +++ b/ext/sockets/tests/mcast_ipv4_send_error.phpt @@ -5,6 +5,12 @@ Multicast support: IPv4 send options with unusual values if (!extension_loaded('sockets')) { die('skip sockets extension not available.'); } +$domain = AF_INET; +$level = IPPROTO_IP; +$s = socket_create($domain, SOCK_DGRAM, SOL_UDP); +if ($s === false) { + die("skip unable to create socket"); +} if (socket_set_option($s, $level, IP_MULTICAST_IF, 1) === false) { die("skip interface 1 either doesn't exist or has no ipv4 address"); } diff --git a/ext/sockets/tests/mcast_ipv6_recv.phpt b/ext/sockets/tests/mcast_ipv6_recv.phpt index 83fc5064c7..62fa1a9c4d 100644 --- a/ext/sockets/tests/mcast_ipv6_recv.phpt +++ b/ext/sockets/tests/mcast_ipv6_recv.phpt @@ -16,7 +16,7 @@ $br = socket_bind($s, '::', 3000); /* On Linux, there is no route ff00::/8 by default on lo, which makes it * troublesome to send multicast traffic from lo, which we must since * we're dealing with interface-local traffic... */ -$so = socket_set_option($s, IPPROTO_IPV6, MCAST_JOIN_GROUP, array( +$so = @socket_set_option($s, IPPROTO_IPV6, MCAST_JOIN_GROUP, array( "group" => 'ff01::114', "interface" => 0, )); @@ -31,11 +31,11 @@ if ($r === false) { if (!defined("MCAST_JOIN_SOURCE_GROUP")) die('skip source operations are unavailable'); -$so = socket_set_option($s, IPPROTO_IPV6, MCAST_LEAVE_GROUP, array( +$so = @socket_set_option($s, IPPROTO_IPV6, MCAST_LEAVE_GROUP, array( "group" => 'ff01::114', "interface" => 0, )); -$so = socket_set_option($s, IPPROTO_IPV6, MCAST_JOIN_SOURCE_GROUP, array( +$so = @socket_set_option($s, IPPROTO_IPV6, MCAST_JOIN_SOURCE_GROUP, array( "group" => 'ff01::114', "interface" => 0, "source" => '2001::dead:beef', diff --git a/ext/sockets/tests/mcast_ipv6_recv_limited.phpt b/ext/sockets/tests/mcast_ipv6_recv_limited.phpt index e989e9b58c..c739264062 100644 --- a/ext/sockets/tests/mcast_ipv6_recv_limited.phpt +++ b/ext/sockets/tests/mcast_ipv6_recv_limited.phpt @@ -13,7 +13,7 @@ $br = socket_bind($s, '::', 3000); /* On Linux, there is no route ff00::/8 by default on lo, which makes it * troublesome to send multicast traffic from lo, which we must since * we're dealing with interface-local traffic... */ -$so = socket_set_option($s, IPPROTO_IPV6, MCAST_JOIN_GROUP, array( +$so = @socket_set_option($s, IPPROTO_IPV6, MCAST_JOIN_GROUP, array( "group" => 'ff01::114', "interface" => 0, )); @@ -24,12 +24,12 @@ $r = socket_sendto($s, $m = "testing packet", strlen($m), 0, 'ff01::114', 3000); if ($r === false) { die('skip unable to send multicast packet.'); } -$so = socket_set_option($s, IPPROTO_IPV6, MCAST_LEAVE_GROUP, array( +$so = @socket_set_option($s, IPPROTO_IPV6, MCAST_LEAVE_GROUP, array( "group" => 'ff01::114', "interface" => 0, )); if (defined("MCAST_JOIN_SOURCE_GROUP")) { - $so = socket_set_option($s, IPPROTO_IPV6, MCAST_JOIN_SOURCE_GROUP, array( + $so = @socket_set_option($s, IPPROTO_IPV6, MCAST_JOIN_SOURCE_GROUP, array( "group" => 'ff01::114', "interface" => 0, "source" => '2001::dead:beef', diff --git a/ext/sockets/tests/socket_export_stream-3.phpt b/ext/sockets/tests/socket_export_stream-3.phpt index 63134cb401..69b0ebe47d 100644 --- a/ext/sockets/tests/socket_export_stream-3.phpt +++ b/ext/sockets/tests/socket_export_stream-3.phpt @@ -9,7 +9,7 @@ $s = socket_create(AF_INET, SOCK_DGRAM, SOL_UDP); $br = socket_bind($s, '0.0.0.0', 58393); if ($br === false) die("SKIP IPv4/port 58393 not available"); -$so = socket_set_option($s, IPPROTO_IP, MCAST_JOIN_GROUP, array( +$so = @socket_set_option($s, IPPROTO_IP, MCAST_JOIN_GROUP, array( "group" => '224.0.0.23', "interface" => "lo", )); diff --git a/ext/sockets/tests/socket_import_stream-3.phpt b/ext/sockets/tests/socket_import_stream-3.phpt index 8a8ac4f5e4..f83e8a487b 100644 --- a/ext/sockets/tests/socket_import_stream-3.phpt +++ b/ext/sockets/tests/socket_import_stream-3.phpt @@ -9,7 +9,7 @@ $s = socket_create(AF_INET, SOCK_DGRAM, SOL_UDP); $br = socket_bind($s, '0.0.0.0', 58379); if ($br === false) die("SKIP IPv4/port 58379 not available"); -$so = socket_set_option($s, IPPROTO_IP, MCAST_JOIN_GROUP, array( +$so = @socket_set_option($s, IPPROTO_IP, MCAST_JOIN_GROUP, array( "group" => '224.0.0.23', "interface" => "lo", )); |