This commit is contained in:
Max Lv
2018-09-02 17:27:59 -07:00
parent dd5e954ab4
commit 46ff0a8045
2 changed files with 13 additions and 6 deletions
+8 -1
View File
@@ -2050,6 +2050,7 @@ main(int argc, char **argv)
}
if (mode != TCP_ONLY) {
int num_listen_ctx = 0;
for (int i = 0; i < server_num; i++) {
const char *host = server_host[i];
const char *port = server_port;
@@ -2061,7 +2062,13 @@ main(int argc, char **argv)
else
LOGI("udp server listening at %s:%s", host ? host : "0.0.0.0", port);
// Setup UDP
init_udprelay(host, port, mtu, crypto, atoi(timeout), iface);
int err = init_udprelay(host, port, mtu, crypto, atoi(timeout), iface);
if (err == -1) continue;
num_listen_ctx++;
}
if (num_listen_ctx == 0) {
FATAL("failed to listen on any address");
}
}