summaryrefslogtreecommitdiff
path: root/main
diff options
context:
space:
mode:
authorseliver <alexeyseliverstov.dev@gmail.com>2018-03-31 04:05:12 +0100
committerNikita Popov <nikita.ppv@gmail.com>2018-07-07 11:47:50 +0200
commit95013042bf85ce1f52e476c5cc301faa97f52a72 (patch)
tree44db3e784d44cbca50892a73fee476ab844bd518 /main
parent67352cb2c01706b75d9a6f2793a2022f4751e355 (diff)
downloadphp-git-95013042bf85ce1f52e476c5cc301faa97f52a72.tar.gz
Fixed bug #76136 (stream_socket_get_name enclosed IPv6 in brackets)
The IPv6 IP of a socket is provided by 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.
Diffstat (limited to 'main')
-rw-r--r--main/network.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/main/network.c b/main/network.c
index 03ceb2ad08..b31e9d659b 100644
--- a/main/network.c
+++ b/main/network.c
@@ -626,7 +626,7 @@ PHPAPI void php_network_populate_name_from_sockaddr(
case AF_INET6:
buf = (char*)inet_ntop(sa->sa_family, &((struct sockaddr_in6*)sa)->sin6_addr, (char *)&abuf, sizeof(abuf));
if (buf) {
- *textaddr = strpprintf(0, "%s:%d",
+ *textaddr = strpprintf(0, "[%s]:%d",
buf, ntohs(((struct sockaddr_in6*)sa)->sin6_port));
}