[Bug 3345] sshd freeze when build without HAVE_PSELECT

bugzilla-daemon at mindrot.org bugzilla-daemon at mindrot.org
Wed Sep 8 16:30:47 AEST 2021


https://bugzilla.mindrot.org/show_bug.cgi?id=3345

--- Comment #4 from Yaroslav <yaroslav.kuzmin at vmssoftware.com> ---
(In reply to Darren Tucker from comment #3)
> (In reply to Yaroslav from comment #2)
> > I added the following code and it solved the problem
> > 
> > 200     nfds = MAX(nfds, notify_pipe[0]);
> > 201     ++nfds;
> 
> As I described above I don't think that's correct.  In the case
> where nfds was not increased in the MAX(), nfds is being incremented
> twice which may cause other problems.
> 
> The code I suggested does not do that.  Does it also fix the problem?

I tested on 5 connections everything works correctly.

But I agree that nfsd  contains information about the number of file
descriptors, and MAX  will check the maximum descriptor


  if (unmasked) {
    pselect_notify_setup();
    pselect_notify_prepare(readfds);
    --nfds;
    nfds = MAX(nfds, notify_pipe[0]);
    ++nfds;
 }

-- 
You are receiving this mail because:
You are watching the assignee of the bug.
You are watching someone on the CC list of the bug.


More information about the openssh-bugs mailing list