summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBing Sun <subi.the.dream.walker@gmail.com>2016-04-12 16:51:16 +0800
committerBing Sun <subi.the.dream.walker@gmail.com>2016-04-12 16:51:16 +0800
commite491ebcc04f2fa2d8918f56cc0763b19835ded8a (patch)
tree88f34829879f4a4ae625ea60157cba2841b97dd9
parent50e5b666d85c92a963ed6c1d4150683e87b8b9a5 (diff)
downloaddistcc-git-e491ebcc04f2fa2d8918f56cc0763b19835ded8a.tar.gz
Fix the TCP host parsing of IPv6 address (#175)
A bracket is not a part of an IPv6 address.
-rw-r--r--src/hosts.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/hosts.c b/src/hosts.c
index a237bd8..3a58366 100644
--- a/src/hosts.c
+++ b/src/hosts.c
@@ -334,6 +334,9 @@ static int dcc_parse_tcp_host(struct dcc_hostdef *hostdef,
const char *token = token_start;
if (token[0] == '[') {
+ /* Skip the leading bracket, which is not part of the address */
+ token++;
+
/* We have an IPv6 Address */
if ((ret = dcc_dup_part(&token, &hostdef->hostname, "/] \t\n\r\f,")))
return ret;