[php-src] master: CI: Fix gh20532.phpt on FreeBSD (#24424)

From: Date: Mon, 19 Oct 2026 13:50:25 +0000
Subject: [php-src] master: CI: Fix gh20532.phpt on FreeBSD (#24424)
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-142449@lists.php.net to get a copy of this message
Author: Weilin Du (LamentXU123) Committer: GitHub (web-flow) Pusher: LamentXU123 Date: 2026-10-19T21:50:21+08:00 Commit: https://github.com/php/php-src/commit/c5093f7caaebeafb6d00e67d4e7d899a90931b44 Raw diff: https://github.com/php/php-src/commit/c5093f7caaebeafb6d00e67d4e7d899a90931b44.diff CI: Fix gh20532.phpt on FreeBSD (#24424) FreeBSD's getaddrinfo() does not immediately return errors from numeric address parsing and can fall back to name resolution. Changed paths: M ext/sockets/tests/gh20532.phpt Diff: diff --git a/ext/sockets/tests/gh20532.phpt b/ext/sockets/tests/gh20532.phpt index 2bec6953dac4..35030ecd2794 100644 --- a/ext/sockets/tests/gh20532.phpt +++ b/ext/sockets/tests/gh20532.phpt @@ -6,7 +6,8 @@ sockets <?php $error_code = 0; var_dump(socket_addrinfo_lookup(".whynot", null, [], $error_code) === false && in_array($error_code, [EAI_NONAME, EAI_FAIL], true)); -var_dump(socket_addrinfo_lookup("2001:db8::1", null, ['ai_family' => AF_INET], $error_code) === false && in_array($error_code, [EAI_FAMILY, EAI_ADDRFAMILY, EAI_NONAME, EAI_NODATA])); +// Prevent name resolution on platforms that do not recognize an address of the wrong family. +var_dump(socket_addrinfo_lookup("2001:db8::1", null, ['ai_family' => AF_INET, 'ai_flags' => AI_NUMERICHOST], $error_code) === false && in_array($error_code, [EAI_FAMILY, EAI_ADDRFAMILY, EAI_NONAME, EAI_NODATA])); var_dump(socket_addrinfo_lookup("example.com", "http", ['ai_socktype' => SOCK_RAW, 'ai_flags' => 2147483647], $error_code) === false && in_array($error_code, [EAI_SOCKTYPE, EAI_SERVICE, EAI_BADFLAGS, EAI_NONAME])); ?> --EXPECT--

« previous php.cvs (#142449) next »