mirror of
https://github.com/samhocevar/rinetd.git
synced 2025-03-14 20:00:11 +08:00
Do not call listen() on UDP listeners.
This commit is contained in:
parent
33e8b8d7f9
commit
a613195ad9
16
rinetd.c
16
rinetd.c
@ -337,13 +337,15 @@ void addServer(char *bindAddress, int bindPort, int bindProto,
|
||||
closesocket(fd);
|
||||
PARSE_ERROR;
|
||||
}
|
||||
if (listen(fd, RINETD_LISTEN_BACKLOG) == SOCKET_ERROR) {
|
||||
/* Warn -- don't exit. */
|
||||
syslog(LOG_ERR, "couldn't listen to "
|
||||
"address %s port %d (%m)\n",
|
||||
bindAddress, bindPort);
|
||||
closesocket(fd);
|
||||
PARSE_ERROR;
|
||||
if (bindProto == protoTcp) {
|
||||
if (listen(fd, RINETD_LISTEN_BACKLOG) == SOCKET_ERROR) {
|
||||
/* Warn -- don't exit. */
|
||||
syslog(LOG_ERR, "couldn't listen to "
|
||||
"address %s port %d (%m)\n",
|
||||
bindAddress, bindPort);
|
||||
closesocket(fd);
|
||||
PARSE_ERROR;
|
||||
}
|
||||
}
|
||||
#if _WIN32
|
||||
u_long ioctltmp;
|
||||
|
@ -16,10 +16,10 @@
|
||||
# to apply to only that forwarding rule
|
||||
#
|
||||
# bindadress bindport connectaddress connectport
|
||||
127.0.0.1 4000 127.0.0.1 3000
|
||||
#127.0.0.1 4000 127.0.0.1 3000
|
||||
#127.0.0.1 4000/udp 127.0.0.1 22
|
||||
#127.0.0.1 4000 127.0.0.1 3000/udp
|
||||
#127.0.0.1 3000/udp 127.0.0.1 22
|
||||
127.0.0.1 4000 127.0.0.1 3000/udp
|
||||
127.0.0.1 3000/udp 127.0.0.1 22
|
||||
|
||||
# logging information
|
||||
logfile /var/log/rinetd.log
|
||||
|
Loading…
Reference in New Issue
Block a user