summaryrefslogtreecommitdiffstats
path: root/usr.bin/ssh/channels.c
diff options
context:
space:
mode:
authormarkus <markus@openbsd.org>2001-05-09 22:51:57 +0000
committermarkus <markus@openbsd.org>2001-05-09 22:51:57 +0000
commitfaaf8659cfac60c55c83cb1b54f418f19511e8d8 (patch)
treea1adc21b39fcc6ff7e15bbee7031e5e3c89d492d /usr.bin/ssh/channels.c
parenttypo; david@phobia.ms (diff)
downloadwireguard-openbsd-faaf8659cfac60c55c83cb1b54f418f19511e8d8.tar.xz
wireguard-openbsd-faaf8659cfac60c55c83cb1b54f418f19511e8d8.zip
fix -R for protocol 2, noticed by greg@nest.cx.
bug was introduced with experimental dynamic forwarding.
Diffstat (limited to 'usr.bin/ssh/channels.c')
-rw-r--r--usr.bin/ssh/channels.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/usr.bin/ssh/channels.c b/usr.bin/ssh/channels.c
index 3c6bdef9aa8..f7e73dd28f5 100644
--- a/usr.bin/ssh/channels.c
+++ b/usr.bin/ssh/channels.c
@@ -40,7 +40,7 @@
*/
#include "includes.h"
-RCSID("$OpenBSD: channels.c,v 1.114 2001/05/08 19:17:30 markus Exp $");
+RCSID("$OpenBSD: channels.c,v 1.115 2001/05/09 22:51:57 markus Exp $");
#include <openssl/rsa.h>
#include <openssl/dsa.h>
@@ -771,8 +771,9 @@ channel_post_port_listener(Channel *c, fd_set * readset, fd_set * writeset)
rtype = (c->type == SSH_CHANNEL_RPORT_LISTENER) ?
"forwarded-tcpip" : "direct-tcpip";
- nextstate = (c->host_port == 0) ? SSH_CHANNEL_DYNAMIC :
- SSH_CHANNEL_OPENING;
+ nextstate = (c->host_port == 0 &&
+ c->type != SSH_CHANNEL_RPORT_LISTENER) ?
+ SSH_CHANNEL_DYNAMIC : SSH_CHANNEL_OPENING;
addrlen = sizeof(addr);
newsock = accept(c->sock, &addr, &addrlen);