bug & patch in ServerAliveInterval (openssh 4.3-p2)

catamus gogu at l.route666.net
Thu May 4 17:59:48 EST 2006

On Thu, 4 May 2006, Darren Tucker wrote:

> On Sat, Apr 22, 2006 at 08:02:47PM +0300, catamus wrote:
>> I have found that ServerAliveInterval & ServerAliveCountMax have
>> some bug. Basically the ssh-alive check function (that verify the
>> peer is alive) is called only if no data at all gets into ssh (when it
>> should work only for server channel).I am pretty sure developers know
>> about this ..anyway I have tried to fix this issue. Here is the patch:
> Could you please give an example of the circumstances under which this
> might happen?  Repeatedly banging on the keyboard generating traffic
> on stdin?

Well, yes keyboard is one, forwarded tcp is other.. (anything that
make select return before timeout expire)

> I'm not sure the patch is quite right, though.
>> +       if(FD_ISSET(connection_out, *readsetp)) {
>> +               tv.tv_sec = 0;
>> +               tv.tv_usec = 0;
> This doesn't look right... it's checking if the connection out is readable?
> Maybe that should be this?
> 	if (FD_ISSET(connection_in, *readsetp) ||
> 	    FD_ISSET(connection_out, *writesetp))

I think only
 	if(FD_ISSET(connection_in, *readsetp))

we reset the timer when we have data from remote peer..


More information about the openssh-unix-dev mailing list