Skip to content

ext/sockets/tests/mcast_ipv6_*.phpt: suppress no-ipv6 warning #11651

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 10, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion ext/sockets/tests/mcast_ipv6_recv.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@ sockets
if (!defined('IPPROTO_IPV6')) {
die('skip IPv6 not available.');
}
$s = socket_create(AF_INET6, SOCK_DGRAM, SOL_UDP);
// hide the output from socket_create() because it can raise
// a warning if (for example) the linux kernel is lacking ipv6
$s = @socket_create(AF_INET6, SOCK_DGRAM, SOL_UDP);
if ($s === false) {
die("skip unable to create socket");
}
Expand Down
7 changes: 6 additions & 1 deletion ext/sockets/tests/mcast_ipv6_recv_limited.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,12 @@ sockets
if (!defined('IPPROTO_IPV6')) {
die('skip IPv6 not available.');
}
$s = socket_create(AF_INET6, SOCK_DGRAM, SOL_UDP);
// hide the output from socket_create() because it can raise
// a warning if (for example) the linux kernel is lacking ipv6
$s = @socket_create(AF_INET6, SOCK_DGRAM, SOL_UDP);
if ($s === false) {
die("skip unable to create socket");
}
$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
Expand Down
5 changes: 4 additions & 1 deletion ext/sockets/tests/mcast_ipv6_send.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,10 @@ if (getenv('CI_NO_IPV6') || !defined('IPPROTO_IPV6')) {
die('skip IPv6 not available.');
}
$level = IPPROTO_IPV6;
$s = socket_create(AF_INET6, SOCK_DGRAM, SOL_UDP) or die("skip Cannot create socket");

// hide the output from socket_create() because it can raise
// a warning if (for example) the linux kernel is lacking ipv6
$s = @socket_create(AF_INET6, SOCK_DGRAM, SOL_UDP) or die("skip Cannot create socket");
if (socket_set_option($s, $level, IPV6_MULTICAST_IF, 1) === false) {
die("skip interface 1 either doesn't exist or has no ipv6 address");
}
Expand Down