summaryrefslogtreecommitdiffhomepage
path: root/cli-tcpfwd.c
diff options
context:
space:
mode:
authorMatt Johnston <matt@ucc.asn.au>2015-02-28 23:24:30 +0800
committerMatt Johnston <matt@ucc.asn.au>2015-02-28 23:24:30 +0800
commit125a970d71d5b43b7b648412fcc614e782c42a1d (patch)
tree8bbc278b055fd573a9d40ba171d9031626551371 /cli-tcpfwd.c
parent59bb1777be18b8f1b263aaeabe54a32933fc871d (diff)
parent89c0b2a6d863e54bd0253355146f09b92edeccda (diff)
merge tcp fastopen
Diffstat (limited to 'cli-tcpfwd.c')
-rw-r--r--cli-tcpfwd.c16
1 files changed, 2 insertions, 14 deletions
diff --git a/cli-tcpfwd.c b/cli-tcpfwd.c
index 3894044..ec65f41 100644
--- a/cli-tcpfwd.c
+++ b/cli-tcpfwd.c
@@ -30,6 +30,7 @@
#include "runopts.h"
#include "session.h"
#include "ssh.h"
+#include "netio.h"
#ifdef ENABLE_CLI_REMOTETCPFWD
static int newtcpforwarded(struct Channel * channel);
@@ -215,7 +216,6 @@ static int newtcpforwarded(struct Channel * channel) {
m_list_elem * iter = NULL;
struct TCPFwdEntry *fwd;
char portstring[NI_MAXSERV];
- int sock;
int err = SSH_OPEN_ADMINISTRATIVELY_PROHIBITED;
origaddr = buf_getstring(ses.payload, NULL);
@@ -254,19 +254,7 @@ static int newtcpforwarded(struct Channel * channel) {
}
snprintf(portstring, sizeof(portstring), "%d", fwd->connectport);
- sock = connect_remote(fwd->connectaddr, portstring, NULL);
- if (sock < 0) {
- TRACE(("leave newtcpdirect: sock failed"))
- err = SSH_OPEN_CONNECT_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(fwd->connectaddr, portstring, channel_connect_done, channel);
channel->prio = DROPBEAR_CHANNEL_PRIO_UNKNOWABLE;