=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/ssh/mux.c,v retrieving revision 1.13 retrieving revision 1.14 diff -u -r1.13 -r1.14 --- src/usr.bin/ssh/mux.c 2010/01/29 20:16:17 1.13 +++ src/usr.bin/ssh/mux.c 2010/01/30 02:54:53 1.14 @@ -1,4 +1,4 @@ -/* $OpenBSD: mux.c,v 1.13 2010/01/29 20:16:17 djm Exp $ */ +/* $OpenBSD: mux.c,v 1.14 2010/01/30 02:54:53 djm Exp $ */ /* * Copyright (c) 2002-2008 Damien Miller * @@ -197,8 +197,10 @@ debug2("%s: channel %d: not open", __func__, sc->self); chan_mark_dead(sc); } else { - chan_read_failed(sc); - chan_write_failed(sc); + if (sc->istate == CHAN_INPUT_OPEN) + chan_read_failed(sc); + if (sc->ostate == CHAN_OUTPUT_OPEN) + chan_write_failed(sc); } } channel_cancel_cleanup(c->self);