]> git.meshlink.io Git - meshlink/commitdiff
Put brackets around IPv6 addresses in invitation URL, even if there is no port number.
authorGuus Sliepen <guus@tinc-vpn.org>
Mon, 28 Apr 2014 14:26:05 +0000 (16:26 +0200)
committerSaverio Proto <zioproto@gmail.com>
Mon, 28 Apr 2014 14:26:05 +0000 (16:26 +0200)
src/invitation.c

index 14a4120c80719af6270f28706250c28a43fab607..1fba77e15f3c1e4099ef2e7c6be33e0e8aef7b4f 100644 (file)
@@ -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);