PHP :: Bug #30057 :: IPv6 support broken
| Bug #30057 | IPv6 support broken | |||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Submitted: | 2004-09-10 22:18 UTC | Modified: | 2004-09-26 03:18 UTC |
|
||||||||||
| From: | neon at neon-line dot net | Assigned: | ||||||||||||
| Status: | Closed | Package: | Sockets related | |||||||||||
| PHP Version: | 5.0.1 | OS: | FreeBSD 4.10 | |||||||||||
| Private report: | No | CVE-ID: | None | |||||||||||
[2004-09-10 22:18 UTC] neon at neon-line dot net
Description:
------------
Unable to connect to IPv6 addresses or hostnames pointing to an IPv6 address, even though IPv6 is properly configured.
PHP has been configured with --enable-ipv6 option and phpinfo shows that it is indeed enabled.
I checked with telnet utility that these hosts respond and with that they did.
Reproduce code:
---------------
fsockopen("[::1]",80);
echo "--\n";
fsockopen("[fe80:1:1::1]",80);
echo "--\n";
fsockopen("fe80:1:1::1",80);
echo "--\n";
fsockopen("ipv6.host.name",80);
Expected result:
----------------
--
--
--
Actual result:
--------------
Warning: fsockopen(): php_network_getaddresses: gethostbyname failed
Warning: fsockopen(): unable to connect to [::1]:80 (Unknown error)
--
Warning: fsockopen(): php_network_getaddresses: gethostbyname failed
Warning: fsockopen(): unable to connect to [fe80:1:1::1]:80 (Unknown error)
--
Warning: fsockopen(): unable to connect to fe80:1:1::1:80 (Operation timed out)
--
Warning: fsockopen(): php_network_getaddresses: gethostbyname failed
Warning: fsockopen(): unable to connect to ipv6.host.name:80 (Unknown error)
Patches
Pull Requests
History
AllCommentsChangesGit/SVN commits
[2004-09-10 23:56 UTC] pollita@php.net
Do any of these work? fsockopen('tcp://::1', 80); fsockopen('tcp://[::1]', 80); stream_socket_client('tcp://[::1]:80');[2004-09-11 11:16 UTC] neon at neon-line dot net
[2004-09-11 11:37 UTC] wez@php.net
[2004-09-11 11:50 UTC] neon at neon-line dot net
[2004-09-11 18:35 UTC] pollita@php.net
[2004-09-11 18:45 UTC] neon at neon-line dot net
[2004-09-11 18:45 UTC] pollita@php.net
[2004-09-11 19:05 UTC] neon at neon-line dot net
[2004-09-12 01:29 UTC] wez@php.net
Please try manually compiling this (slightly altered code from configure.in), running it, and pasting the output here in this bug report; thanks! 1/ Copy the code into v6test.c 2/ cc -o v6test v6test.c 3/ ./v6test #include <netdb.h> #include <sys/types.h> int main(void) { struct addrinfo *ai, *pai, hints; memset(&hints, 0, sizeof(hints)); hints.ai_flags = AI_NUMERICHOST; if (getaddrinfo("127.0.0.1", NULL, &hints, &ai) < 0) { printf("FAIL-1\n"); exit(1); } if (ai == NULL) { printf("FAIL-2\n"); exit(1); } pai = ai; while (pai) { if (pai->ai_family != AF_INET) { /* 127.0.0.1/NUMERICHOST should only resolve ONE way */ printf("FAIL-3\n"); exit(1); } if (pai->ai_addr->sa_family != AF_INET) { /* 127.0.0.1/NUMERICHOST should only resolve ONE way */ printf("FAIL-4\n"); exit(1); } pai = pai->ai_next; } freeaddrinfo(ai); printf("OK!\n"); exit(0); }[2004-09-12 02:12 UTC] pollita@php.net
[2004-09-12 09:10 UTC] neon at neon-line dot net
[2004-09-12 11:27 UTC] wez@php.net
[2004-09-12 11:33 UTC] neon at neon-line dot net
[2004-09-17 18:02 UTC] neon at neon-line dot net
[2004-09-25 13:14 UTC] neon at neon-line dot net
[2004-09-26 03:18 UTC] wez@php.net