From d64827bf35c9784b346cf43c1c004db77f07c479 Mon Sep 17 00:00:00 2001 From: CC Ding Date: Thu, 18 Sep 2014 02:01:29 +0000 Subject: [PATCH] Get rid of the square brackets when using numeric ipv6 address. --- src/libckpool.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/libckpool.c b/src/libckpool.c index 8a568e0d..5d507672 100644 --- a/src/libckpool.c +++ b/src/libckpool.c @@ -353,6 +353,12 @@ bool extract_sockaddr(char *url, char **sockaddr_url, char **sockaddr_port) } else url_len = strlen(url_begin); + /* Get rid of the [] */ + if (ipv6_begin && ipv6_end && ipv6_end > ipv6_begin){ + url_len -= 2; + url_begin++; + } + if (url_len < 1) { LOGWARNING("Null length URL passed to extract_sockaddr"); return false;