View | Details | Raw Unified | Return to bug 10
Collapse All | Expand All

(-)openssh-3.0p1/channels.h (+1 lines)
Lines 143-148 Link Here
143
void	 channel_set_fds(int, int, int, int, int, int);
143
void	 channel_set_fds(int, int, int, int, int, int);
144
void	 channel_free(Channel *);
144
void	 channel_free(Channel *);
145
void	 channel_free_all(void);
145
void	 channel_free_all(void);
146
void	 channel_zero_fd_set(fd_set *, int);
146
void	 channel_stop_listening(void);
147
void	 channel_stop_listening(void);
147
148
148
void	 channel_send_open(int);
149
void	 channel_send_open(int);
(-)openssh-3.0p1/channels.c (+6 lines)
Lines 1564-1569 Link Here
1564
 * select bitmasks.
1564
 * select bitmasks.
1565
 */
1565
 */
1566
void
1566
void
1567
channel_zero_fd_set(fd_set *setp, int maxfdp)
1568
{
1569
	memset(setp, 0, howmany(maxfdp + 1, NFDBITS) * sizeof(fd_mask));
1570
}
1571
1572
void
1567
channel_prepare_select(fd_set **readsetp, fd_set **writesetp, int *maxfdp,
1573
channel_prepare_select(fd_set **readsetp, fd_set **writesetp, int *maxfdp,
1568
    int *nallocp, int rekeying)
1574
    int *nallocp, int rekeying)
1569
{
1575
{
(-)openssh-3.0p1/clientloop.c (-4 / +4 lines)
Lines 346-353 Link Here
346
		if (session_closed && !channel_still_open() &&
346
		if (session_closed && !channel_still_open() &&
347
		    !packet_have_data_to_write()) {
347
		    !packet_have_data_to_write()) {
348
			/* clear mask since we did not call select() */
348
			/* clear mask since we did not call select() */
349
			memset(*readsetp, 0, *maxfdp);
349
			channel_zero_fd_set(*readsetp, *maxfdp);
350
			memset(*writesetp, 0, *maxfdp);
350
			channel_zero_fd_set(*writesetp, *maxfdp);
351
			return;
351
			return;
352
		} else {
352
		} else {
353
			FD_SET(connection_in, *readsetp);
353
			FD_SET(connection_in, *readsetp);
Lines 375-382 Link Here
375
		 * We have to return, because the mainloop checks for the flags
375
		 * We have to return, because the mainloop checks for the flags
376
		 * set by the signal handlers.
376
		 * set by the signal handlers.
377
		 */
377
		 */
378
		memset(*readsetp, 0, *maxfdp);
378
		channel_zero_fd_set(*readsetp, *maxfdp);
379
		memset(*writesetp, 0, *maxfdp);
379
		channel_zero_fd_set(*writesetp, *maxfdp);
380
380
381
		if (errno == EINTR)
381
		if (errno == EINTR)
382
			return;
382
			return;
(-)openssh-3.0p1/serverloop.c (-2 / +2 lines)
Lines 272-279 Link Here
272
	ret = select((*maxfdp)+1, *readsetp, *writesetp, NULL, tvp);
272
	ret = select((*maxfdp)+1, *readsetp, *writesetp, NULL, tvp);
273
273
274
	if (ret == -1) {
274
	if (ret == -1) {
275
		memset(*readsetp, 0, *maxfdp);
275
		channel_zero_fd_set(*readsetp, *maxfdp);
276
		memset(*writesetp, 0, *maxfdp);
276
		channel_zero_fd_set(*writesetp, *maxfdp);
277
		if (errno != EINTR)
277
		if (errno != EINTR)
278
			error("select: %.100s", strerror(errno));
278
			error("select: %.100s", strerror(errno));
279
	} else if (ret == 0 && client_alive_scheduled)
279
	} else if (ret == 0 && client_alive_scheduled)

Return to bug 10