diff options
author | Matt Johnston <matt@ucc.asn.au> | 2015-02-28 23:24:30 +0800 |
---|---|---|
committer | Matt Johnston <matt@ucc.asn.au> | 2015-02-28 23:24:30 +0800 |
commit | 125a970d71d5b43b7b648412fcc614e782c42a1d (patch) | |
tree | 8bbc278b055fd573a9d40ba171d9031626551371 /cli-tcpfwd.c | |
parent | 59bb1777be18b8f1b263aaeabe54a32933fc871d (diff) | |
parent | 89c0b2a6d863e54bd0253355146f09b92edeccda (diff) |
merge tcp fastopen
Diffstat (limited to 'cli-tcpfwd.c')
-rw-r--r-- | cli-tcpfwd.c | 16 |
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; |