X-Git-Url: http://tinc-vpn.org/git/browse?a=blobdiff_plain;f=src%2Fnet_setup.c;h=96a7224781bc1772d93e1bb20a46d4c9687b1bc6;hb=ddd0cd47bc0bb3478b7d250192248a1e3aa2a243;hp=6d15fcf1d6ad0a3342b46d6b9481dff1e41b88ce;hpb=116f2ed27a74982e4d1a19b7a8fd08b0aaee1f8d;p=tinc diff --git a/src/net_setup.c b/src/net_setup.c index 6d15fcf1..96a72247 100644 --- a/src/net_setup.c +++ b/src/net_setup.c @@ -445,7 +445,6 @@ bool setup_myself_reloadable(void) { char *fmode = NULL; char *bmode = NULL; char *afname = NULL; - char *address = NULL; char *space; bool choice; @@ -1037,7 +1036,7 @@ static bool setup_myself(void) { /* If no Port option was specified, set myport to the port used by the first listening socket. */ - if(!port_specified) { + if(!port_specified || atoi(myport) == 0) { sockaddr_t sa; socklen_t salen = sizeof sa; if(!getsockname(listen_socket[0].udp.fd, &sa.sa, &salen)) {