projects
/
tinc
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Put brackets around IPv6 addresses in invitation URL, even if there is no port number.
[tinc]
/
src
/
invitation.c
diff --git
a/src/invitation.c
b/src/invitation.c
index
110e395
..
63a443d
100644
(file)
--- a/
src/invitation.c
+++ b/
src/invitation.c
@@
-1,6
+1,6
@@
/*
invitation.c -- Create and accept invitations
/*
invitation.c -- Create and accept invitations
- Copyright (C) 2013 Guus Sliepen <guus@tinc-vpn.org>
+ Copyright (C) 2013
-2014
Guus Sliepen <guus@tinc-vpn.org>
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
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 {
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);
}
free(hostname);