projects
/
tinc
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fix listen_sockets overflow in close_network_connections()
[tinc]
/
src
/
net_setup.c
diff --git
a/src/net_setup.c
b/src/net_setup.c
index
2cd5818
..
b88f526
100644
(file)
--- a/
src/net_setup.c
+++ b/
src/net_setup.c
@@
-674,6
+674,7
@@
static bool add_listen_address(char *address, bool bindto) {
}
if(listen_sockets >= MAXSOCKETS) {
}
if(listen_sockets >= MAXSOCKETS) {
+ listen_sockets = MAXSOCKETS;
logger(DEBUG_ALWAYS, LOG_ERR, "Too many listening sockets");
freeaddrinfo(ai);
return false;
logger(DEBUG_ALWAYS, LOG_ERR, "Too many listening sockets");
freeaddrinfo(ai);
return false;
@@
-1095,6
+1096,7
@@
static bool setup_myself(void) {
#endif
if(listen_sockets > MAXSOCKETS) {
#endif
if(listen_sockets > MAXSOCKETS) {
+ listen_sockets = MAXSOCKETS;
logger(DEBUG_ALWAYS, LOG_ERR, "Too many listening sockets");
return false;
}
logger(DEBUG_ALWAYS, LOG_ERR, "Too many listening sockets");
return false;
}