From: Guus Sliepen Date: Fri, 25 Apr 2014 15:00:55 +0000 (+0200) Subject: Put brackets around IPv6 addresses in invitation URL, even if there is no port number. X-Git-Tag: release-1.1pre11~123 X-Git-Url: https://tinc-vpn.org/git/browse?p=tinc;a=commitdiff_plain;h=18698c4e123d1ed22f3a2fc5529fac62fbabaf19 Put brackets around IPv6 addresses in invitation URL, even if there is no port number. --- diff --git a/src/invitation.c b/src/invitation.c index cdef3d04..63a443d4 100644 --- a/src/invitation.c +++ b/src/invitation.c @@ -197,8 +197,10 @@ done: else xasprintf(&hostport, "%s:%s", hostname, port); } else { - hostport = hostname; - hostname = NULL; + if(strchr(hostname, ':')) + xasprintf(&hostport, "[%s]", hostname); + else + hostport = xstrdup(hostname); } free(hostname);