-
Notifications
You must be signed in to change notification settings - Fork 7.9k
Fixed bug #76136 (stream_socket_get_name enclosed IPv6 in brackets) #3202
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
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing ?>
.
Also, please use EXPECT
, is simpler than EXPECTF
👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
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.