no secrets are revealed by sending out this information.
.Bl -tag -width indent
-.It Va Address Li = Ar address Bq recommended
+.It Va Address Li = Ar address Oo port Oc Bq recommended
The IP address or hostname of this tinc daemon on the real network.
This will only be used when trying to make an outgoing connection to this tinc daemon.
+Optionally, a port can be specified to use for this address.
Multiple
.Va Address
variables can be specified, in which case each address will be tried until a working
After the path MTU has been discovered, it will be enforced on the VPN.
.It Va Port Li = Ar port Pq 655
-The port number on which this tinc daemon is listening for incoming connections.
+The port number on which this tinc daemon is listening for incoming connections,
+which is used if no port number is specified in an
+.Va Address
+statement.
.It Va PublicKey Li = Ar key Bq obsolete
The public RSA key of this tinc daemon.
@table @asis
@cindex Address
-@item Address = <@var{IP address}|@var{hostname}> [recommended]
+@item Address = <@var{IP address}|@var{hostname}> [<port>] [recommended]
This variable is only required if you want to connect to this host. It
must resolve to the external IP address where the host can be reached,
not the one that is internal to the VPN.
+If no port is specified, the default Port is used.
@cindex Cipher
@item Cipher = <@var{cipher}> (blowfish)
}
void do_outgoing_connection(connection_t *c) {
- char *address, *port;
+ char *address, *port, *space;
int result;
if(!c->outgoing) {
get_config_string(c->outgoing->cfg, &address);
- if(!get_config_string(lookup_config(c->config_tree, "Port"), &port))
- xasprintf(&port, "655");
+ space = strchr(address, ' ');
+ if(space) {
+ port = xstrdup(space + 1);
+ *space = 0;
+ } else {
+ if(!get_config_string(lookup_config(c->config_tree, "Port"), &port))
+ port = xstrdup("655");
+ }
c->outgoing->ai = str2addrinfo(address, port, SOCK_STREAM);
free(address);