=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/ssh/mux.c,v retrieving revision 1.11 retrieving revision 1.12 diff -u -r1.11 -r1.12 --- src/usr.bin/ssh/mux.c 2010/01/26 02:15:20 1.11 +++ src/usr.bin/ssh/mux.c 2010/01/27 13:26:17 1.12 @@ -1,4 +1,4 @@ -/* $OpenBSD: mux.c,v 1.11 2010/01/26 02:15:20 djm Exp $ */ +/* $OpenBSD: mux.c,v 1.12 2010/01/27 13:26:17 djm Exp $ */ /* * Copyright (c) 2002-2008 Damien Miller * @@ -193,7 +193,13 @@ __func__, c->self, c->remote_id); c->remote_id = -1; sc->ctl_chan = -1; - chan_mark_dead(sc); + if (sc->type != SSH_CHANNEL_OPEN) { + debug2("%s: channel %d: not open", __func__, sc->self); + chan_mark_dead(c); + } else { + chan_read_failed(sc); + chan_write_failed(sc); + } } channel_cancel_cleanup(c->self); }