Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit c28ad7b

Browse files
committed
Issue #2122
Allow IPv6 address within square brackets
1 parent 982bd13 commit c28ad7b

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

library.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2340,7 +2340,7 @@ PHP_REDIS_API int redis_sock_connect(RedisSock *redis_sock)
23402340
#ifdef HAVE_IPV6
23412341
/* If we've got IPv6 and find a colon in our address, convert to proper
23422342
* IPv6 [host]:port format */
2343-
if (strchr(address, ':') != NULL) {
2343+
if (strchr(address, ':') != NULL && strchr(address, '[') == NULL) {
23442344
fmtstr = "%s://[%s]:%d";
23452345
}
23462346
#endif

0 commit comments

Comments
 (0)