X-Git-Url: https://tinc-vpn.org/git/browse?a=blobdiff_plain;f=src%2Finvitation.c;h=3aec3b36f9ec4fb62c92f4d2e570b9cf7bebb3cd;hb=35437a50e2a46861742b6fb8e49d065aa52a04dc;hp=cdef3d0480efa04278ecb834156ef9332de99ec0;hpb=06a4a8c153407b690a3ce3f0e7fdaa8568ccb1a3;p=tinc diff --git a/src/invitation.c b/src/invitation.c index cdef3d04..3aec3b36 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); @@ -248,7 +250,7 @@ int cmd_invite(int argc, char *argv[]) { } free(filename); - // If a daemon is running, ensure no other nodes now about this name + // If a daemon is running, ensure no other nodes know about this name bool found = false; if(connect_tincd(false)) { sendline(fd, "%d %d", CONTROL, REQ_DUMP_NODES);