|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2013-10-02 12:32 UTC] mike@php.net
-Status: Open
+Status: Verified
-Assigned To:
+Assigned To: mike
[2013-10-02 13:56 UTC] mike@php.net
[2013-10-02 13:56 UTC] mike@php.net
-Status: Verified
+Status: Closed
[2014-10-07 23:17 UTC] stas@php.net
[2014-10-07 23:28 UTC] stas@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Wed Oct 29 10:00:01 2025 UTC |
Description: ------------ No matter give fe80::a00:27ff:fe3d:af20 or fe80::a00:27ff:fe3d:af20%eth0 as the address, the socket_connect will just fail. From strace and the PHP source code, what I found is the sin6_scope_id always equals to 0, while with telnet when passed in fe80::a00:27ff:fe3d:af20%eth0, from strace, we got sin6_scope_id=if_nametoindex("eth0"). So the socket_connect code needs be changed for proper IPv6 support. Test script: --------------- #!/usr/bin/php <?php $sock=socket_create(AF_INET6, SOCK_STREAM, 0); if(socket_connect($sock, $argv[1], $argv[2])) echo "Connected to ".$argv[1]." port ".$argv[2]; ?> Expected result: ---------------- If you run the script with ./phpscript 2606:4100:3880:1250::100 80 You should see "Connected to 2606:4100:3880:1250::100 port 80" Actual result: -------------- PHP Warning: socket_connect(): unable to connect [22]: Invalid argument in phpscript on line 4.