diff options
author | 2009-12-14 23:57:22 +0000 | |
---|---|---|
committer | 2009-12-14 23:57:22 +0000 | |
commit | c5c1d29017ba0033ce43a9fefed97218c9b31e36 (patch) | |
tree | a30a324668e68a7a9c1cdd365b0d5b3d6ed11d41 /lib/libc | |
parent | Handle 6yz code as permanent error. (diff) | |
download | wireguard-openbsd-c5c1d29017ba0033ce43a9fefed97218c9b31e36.tar.xz wireguard-openbsd-c5c1d29017ba0033ce43a9fefed97218c9b31e36.zip |
Keep all bits of __svc_fdset up to date, not just those beyond FD_SETSIZE.
Bug found while auditing the same complaint by parfait,
see the previous commit; still not shutting parfait up.
"wow, that's nasty" deraadt@
Diffstat (limited to 'lib/libc')
-rw-r--r-- | lib/libc/rpc/svc.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/libc/rpc/svc.c b/lib/libc/rpc/svc.c index 3796aecfeb3..db8daf2f6e1 100644 --- a/lib/libc/rpc/svc.c +++ b/lib/libc/rpc/svc.c @@ -1,4 +1,4 @@ -/* $OpenBSD: svc.c,v 1.23 2009/12/11 22:03:08 schwarze Exp $ */ +/* $OpenBSD: svc.c,v 1.24 2009/12/14 23:57:22 schwarze Exp $ */ /* * Sun RPC is a product of Sun Microsystems, Inc. and is provided for * unrestricted use provided that this legend is included on all tape @@ -190,7 +190,7 @@ svc_fd_insert(int sock) svc_max_pollfd = slot + 1; if (sock < FD_SETSIZE) FD_SET(sock, &svc_fdset); - else if (sock < __svc_fdsetsize) + if (sock < __svc_fdsetsize && __svc_fdset != &svc_fdset) FD_SET(sock, __svc_fdset); svc_maxfd = max(svc_maxfd, sock); @@ -217,7 +217,7 @@ svc_fd_remove(int sock) svc_used_pollfd--; if (sock < FD_SETSIZE) FD_CLR(sock, &svc_fdset); - else if (sock < __svc_fdsetsize) + if (sock < __svc_fdsetsize && __svc_fdset != &svc_fdset) FD_CLR(sock, __svc_fdset); if (sock == svc_maxfd) { for (svc_maxfd--; svc_maxfd >= 0; svc_maxfd--) |