projects
/
oweals
/
tinc.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
6ea1dfc
)
Properly delete listener socket events on shutdown.
author
Guus Sliepen
<guus@tinc-vpn.org>
Thu, 17 May 2007 19:51:26 +0000
(19:51 +0000)
committer
Guus Sliepen
<guus@tinc-vpn.org>
Thu, 17 May 2007 19:51:26 +0000
(19:51 +0000)
src/net_setup.c
patch
|
blob
|
history
diff --git
a/src/net_setup.c
b/src/net_setup.c
index 65965908002540ab94340526771bb5d62cafc8bd..eeea61a20e13fc3a00a78d6f017f82cd92c8b367 100644
(file)
--- a/
src/net_setup.c
+++ b/
src/net_setup.c
@@
-537,6
+537,11
@@
bool setup_myself(void)
memcpy(&listen_socket[listen_sockets].sa, aip->ai_addr, aip->ai_addrlen);
listen_sockets++;
+
+ if(listen_sockets >= MAXSOCKETS) {
+ logger(LOG_WARNING, _("Maximum of %d listening sockets reached"), MAXSOCKETS);
+ break;
+ }
}
freeaddrinfo(ai);
@@
-623,6
+628,8
@@
void close_network_connections(void)
}
for(i = 0; i < listen_sockets; i++) {
+ event_del(&listen_socket[i].ev_tcp);
+ event_del(&listen_socket[i].ev_udp);
close(listen_socket[i].tcp);
close(listen_socket[i].udp);
}