mirror of
https://github.com/freebsd/freebsd-src.git
synced 2024-12-04 03:49:02 +00:00
Since shutdown(2) on datagram socket is no longer a NOP after rev 316874
don't bother to select/recv on that socket. This prevents syslogd(8) from spinning endlessly when started with the -s option (default). Reported by: peter
This commit is contained in:
parent
6029706346
commit
b98582b146
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=316951
@ -702,7 +702,7 @@ main(int argc, char *argv[])
|
||||
sizeof(fd_mask));
|
||||
|
||||
STAILQ_FOREACH(sl, &shead, next) {
|
||||
if (sl->sl_socket != -1)
|
||||
if (sl->sl_socket != -1 && sl->sl_recv != NULL)
|
||||
FD_SET(sl->sl_socket, fdsr);
|
||||
}
|
||||
i = select(fdsrmax + 1, fdsr, NULL, NULL,
|
||||
@ -2877,6 +2877,7 @@ socksetup(struct peer *pe)
|
||||
struct addrinfo hints, *res, *res0;
|
||||
int error;
|
||||
char *cp;
|
||||
int (*sl_recv)(struct socklist *);
|
||||
/*
|
||||
* We have to handle this case for backwards compatibility:
|
||||
* If there are two (or more) colons but no '[' and ']',
|
||||
@ -3003,6 +3004,7 @@ socksetup(struct peer *pe)
|
||||
}
|
||||
dprintf("new socket fd is %d\n", s);
|
||||
listen(s, 5);
|
||||
sl_recv = socklist_recv_sock;
|
||||
dprintf("shutdown\n");
|
||||
if (SecureMode || res->ai_family == AF_LOCAL) {
|
||||
/* Forbid communication in secure mode. */
|
||||
@ -3013,13 +3015,14 @@ socksetup(struct peer *pe)
|
||||
die(0);
|
||||
}
|
||||
dprintf("listening on socket\n");
|
||||
sl_recv = NULL;
|
||||
} else
|
||||
dprintf("sending on socket\n");
|
||||
addsock(res->ai_addr, res->ai_addrlen,
|
||||
&(struct socklist){
|
||||
.sl_socket = s,
|
||||
.sl_peer = pe,
|
||||
.sl_recv = socklist_recv_sock
|
||||
.sl_recv = sl_recv
|
||||
});
|
||||
}
|
||||
freeaddrinfo(res0);
|
||||
|
Loading…
Reference in New Issue
Block a user