SSH connection hanging on logout

John Bowman bowman at math.ualberta.ca
Fri May 18 10:35:43 EST 2001


> >  			continue;
> >  		if (ftab[c->type] == NULL)
> >  			continue;
> > +		if(c->istate == CHAN_INPUT_OPEN && c->rfd == -1) {
> > +			int type=c->type;
> > +			c->type=SSH_CHANNEL_CLOSED;
> > +			if(channel_find_open() == -1)
> > +			  	shutdown(packet_get_connection_out(),
> > +					 SHUT_RDWR);
> 
> ^^^^^^^^
> 	this cannot be correct. you may _not_ shutdown
> 	the TCP connection. this breaks
> 		ssh -N -L 1234:hostb:5678 hosta
> 
In what way does this "break" tunnelling? It works just fine for me, under
Linux. Try it out on a Linux machine. The hang-on-exit patch has recently been
reported not to work under HP-UX, so Linux is the only OS where this
patch should be applied anyway (at least, until Markus comes up with a
better alternative :-).

While we are on the topic of tunnelling...I have another patch that I am
about to submit to this list that implements a handy enhancement to tunneling
that was proposed by John Hardin of Apropos Retail Management Systems, Inc.
One can now request that the connection not die after the first TCP
connection is closed (via -N) or after a fixed number of seconds (via a sleep
command), but rather that it stays around n seconds after the most recent TCP
connection is closed. More details to follow...

-- John Bowman

University of Alberta
http://www.math.ualberta.ca/~bowman






More information about the openssh-unix-dev mailing list