From: Guus Sliepen Date: Mon, 28 Apr 2014 14:26:05 +0000 (+0200) Subject: Put brackets around IPv6 addresses in invitation URL, even if there is no port number. X-Git-Url: http://git.meshlink.io/?p=meshlink;a=commitdiff_plain;h=ea6d38aa8cbb366831153575c725022db7f84a82 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 14a4120c..1fba77e1 100644 --- a/src/invitation.c +++ b/src/invitation.c @@ -194,8 +194,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);