Fixed bug #76136 (stream_socket_get_name enclosed IPv6 in brackets)#3202
Fixed bug #76136 (stream_socket_get_name enclosed IPv6 in brackets)#3202seliver wants to merge 2 commits intophp:PHP-7.1from seliver:PHP-7.1
Conversation
The IPv6 IP of a socket is provided by the inet_ntop as a string, but this function doesn't enclose the ip in brackets. This patch adds them in the php_network_populate_name_from_sockaddr function.
|
I tried adding the pull request to the bug tracking system, but unfortunately it didn't work. |
tests/output/bug76136.phpt
Outdated
| echo stream_socket_get_name($server, false).PHP_EOL; | ||
| $server = stream_socket_server("tcp://127.0.0.1:1337/"); | ||
| echo stream_socket_get_name($server, false); | ||
| --EXPECTF-- |
There was a problem hiding this comment.
Missing ?>.
Also, please use EXPECT, is simpler than EXPECTF 👍
Added PHP close tag and using expect instead of expectf
|
Is there something else that needs to be done on my side? |
|
@seliver The Travis build is failing with: I assume that means that IPv6 is not supported? This probably needs a SKIPIF check. Otherwise the change looks reasonable to me, but I'm not sure about BC impact etc. @bwoebi Can you check this? Which branch should it land on? |
|
7.3 only, because not every workaround might account for the bug being fixed. We and ReactPHP do, but others might not. |
|
Okay, let's go for PHP 7.3 then. @seliver, can you please update the test to skip if ipv6 is not supported? This will need a |
|
Merged as 9501304 with test adjustment. |
The IPv6 IP of a socket is provided by the inet_ntop as a string,
but this function doesn't enclose the ip in brackets. This patch
adds them in the php_network_populate_name_from_sockaddr function.