mp_rpc_server.C: limit iteration of svc_fdset to FD_SETSIZE, as per spec.
In init() there was code iterating over all of the possible file descriptors in a svc_fdset. fdsets are limited to FD_SETSIZE. This caused coredumps on FreeBSD 10, and possibly other hidden issues. Moving to poll(), rather than select() would be better, but is a bigger job. For now, just limit to the FD_SETSIZE that select() requires.
This commit is contained in:
@@ -244,8 +244,7 @@ init(void (*service_fn)(struct svc_req *, SVCXPRT *))
|
|||||||
(void)endnetconfig(handlep);
|
(void)endnetconfig(handlep);
|
||||||
#endif /* OPT_TLI */
|
#endif /* OPT_TLI */
|
||||||
// now figure out what fd the rpc package is using
|
// now figure out what fd the rpc package is using
|
||||||
int maxfds = _tt_global->maxfds();
|
for (int i=0; i < FD_SETSIZE; i++) {
|
||||||
for (int i=0; i < maxfds; i++) {
|
|
||||||
if (FD_ISSET(i, &svc_fdset)) {
|
if (FD_ISSET(i, &svc_fdset)) {
|
||||||
_rpc_fd = i;
|
_rpc_fd = i;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user