X-Git-Url: http://tinc-vpn.org/git/browse?a=blobdiff_plain;f=src%2Finvitation.c;h=3aec3b36f9ec4fb62c92f4d2e570b9cf7bebb3cd;hb=b6e2b416bf9a5788c8847267b849efcd9e5bbf95;hp=110e3953be34be066c0add8ce0785db69d838f09;hpb=2e318f379992a730f592b4c5261d26d8e1a38cfd;p=tinc diff --git a/src/invitation.c b/src/invitation.c index 110e3953..3aec3b36 100644 --- a/src/invitation.c +++ b/src/invitation.c @@ -1,6 +1,6 @@ /* invitation.c -- Create and accept invitations - Copyright (C) 2013 Guus Sliepen + Copyright (C) 2013-2014 Guus Sliepen This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -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);