summaryrefslogtreecommitdiffhomepage
path: root/svr-tcpfwd.c
diff options
context:
space:
mode:
Diffstat (limited to 'svr-tcpfwd.c')
-rw-r--r--svr-tcpfwd.c16
1 files changed, 2 insertions, 14 deletions
diff --git a/svr-tcpfwd.c b/svr-tcpfwd.c
index f2c4b93..b3928bc 100644
--- a/svr-tcpfwd.c
+++ b/svr-tcpfwd.c
@@ -33,6 +33,7 @@
#include "listener.h"
#include "runopts.h"
#include "auth.h"
+#include "netio.h"
#ifndef ENABLE_SVR_REMOTETCPFWD
@@ -236,7 +237,6 @@ static int newtcpdirect(struct Channel * channel) {
unsigned char* orighost = NULL;
unsigned int origport;
char portstring[NI_MAXSERV];
- int sock;
int len;
int err = SSH_OPEN_ADMINISTRATIVELY_PROHIBITED;
@@ -270,19 +270,7 @@ static int newtcpdirect(struct Channel * channel) {
}
snprintf(portstring, sizeof(portstring), "%d", destport);
- sock = connect_remote(desthost, portstring, NULL);
- if (sock < 0) {
- err = SSH_OPEN_CONNECT_FAILED;
- TRACE(("leave newtcpdirect: sock failed"))
- goto out;
- }
-
- ses.maxfd = MAX(ses.maxfd, sock);
-
- /* We don't set readfd, that will get set after the connection's
- * progress succeeds */
- channel->writefd = sock;
- channel->initconn = 1;
+ channel->conn_pending = connect_remote(desthost, portstring, channel_connect_done, channel);
channel->prio = DROPBEAR_CHANNEL_PRIO_UNKNOWABLE;