diff --git a/crypto/openssh/channels.c b/crypto/openssh/channels.c index ee3c787922fb..d47af7911f04 100644 --- a/crypto/openssh/channels.c +++ b/crypto/openssh/channels.c @@ -1,4 +1,4 @@ -/* $OpenBSD: channels.c,v 1.415 2022/03/30 21:10:25 djm Exp $ */ +/* $OpenBSD: channels.c,v 1.416 2022/04/11 22:52:08 djm Exp $ */ /* * Author: Tatu Ylonen * Copyright (c) 1995 Tatu Ylonen , Espoo, Finland @@ -2601,7 +2601,12 @@ channel_prepare_poll(struct ssh *ssh, struct pollfd **pfdp, u_int *npfd_allocp, u_int i, oalloc, p, npfd = npfd_reserved; channel_before_prepare_io(ssh); /* might create a new channel */ - + /* clear out I/O flags from last poll */ + for (i = 0; i < sc->channels_alloc; i++) { + if (sc->channels[i] == NULL) + continue; + sc->channels[i]->io_want = sc->channels[i]->io_ready = 0; + } /* Allocate 4x pollfd for each channel (rfd, wfd, efd, sock) */ if (sc->channels_alloc >= (INT_MAX / 4) - npfd_reserved) fatal_f("too many channels"); /* shouldn't happen */