Fix a bug that caused tinc to ignore all but the last listening socket.
This commit is contained in:
parent
46506b7aaf
commit
d9ad3d313d
1 changed files with 6 additions and 2 deletions
|
@ -580,6 +580,7 @@ static bool setup_myself(void) {
|
||||||
|
|
||||||
/* Open sockets */
|
/* Open sockets */
|
||||||
|
|
||||||
|
listen_sockets = 0;
|
||||||
cfg = lookup_config(config_tree, "BindToAddress");
|
cfg = lookup_config(config_tree, "BindToAddress");
|
||||||
|
|
||||||
do {
|
do {
|
||||||
|
@ -601,9 +602,12 @@ static bool setup_myself(void) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
listen_sockets = 0;
|
|
||||||
|
|
||||||
for(aip = ai; aip; aip = aip->ai_next) {
|
for(aip = ai; aip; aip = aip->ai_next) {
|
||||||
|
if(listen_sockets >= MAXSOCKETS) {
|
||||||
|
logger(LOG_ERR, "Too many listening sockets");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
listen_socket[listen_sockets].tcp =
|
listen_socket[listen_sockets].tcp =
|
||||||
setup_listen_socket((sockaddr_t *) aip->ai_addr);
|
setup_listen_socket((sockaddr_t *) aip->ai_addr);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue