OpenSSH Bug / Fix

Brian Genisio briang at OasisAdvancedEngineering.com
Tue May 6 22:58:03 EST 2003


To Whom It May Concern,

Our team has found what we believe to be a bug in the code for SSHD.  When
creating an SSH port forward between a Linux machine (server) and a machine running 
Cygwin (client), we were getting buffering of data coming from the server.  This buffering 
caused small ammounts of data to be bursted, instead of sent immediately.  Also, since 
debug output showed that "TCP_NODELAY" was being set on the sockets in both SSHD
and SSH, we were perplexed.  However, more research into the issue revealed
the problem.

While the socket option "TCP_NODELAY" is being set on SSH port forwarding sockets 
by default, when setting up a Remote or Local Forward "TCP_NODELAY" is not set on the
main connection.  This can cause buffering of data flowing from the server, but not the other
direction.  The fix that we have proven to work is to add the following code of the most recent
source release:

In the "main" function of "sshd.c":
 - add a call to "set_nodelay(newsock)" immediately after the "accept()"
call.  This will ensure that data travelling from this socket will not buffer and cause a bursting effect
for small ammounts of data being sent at a fast rate.

Thank you,
Brian Genisio
Oasis Advanced Engineering





More information about the openssh-unix-dev mailing list