diff svr-tcpfwd.c @ 70:b0316ce64e4b

Merging in the changes from 0.41-0.43 main Dropbear tree
author Matt Johnston <matt@ucc.asn.au>
date Thu, 12 Aug 2004 16:41:58 +0000
parents efb5e0b335cf
children e3adf4cf5465
line wrap: on
line diff
--- a/svr-tcpfwd.c	Thu Aug 12 15:41:36 2004 +0000
+++ b/svr-tcpfwd.c	Thu Aug 12 16:41:58 2004 +0000
@@ -208,7 +208,7 @@
 	char portstring[NI_MAXSERV];
 	int sock;
 	int len;
-	int ret = DROPBEAR_FAILURE;
+	int err = SSH_OPEN_ADMINISTRATIVELY_PROHIBITED;
 
 	if (opts.nolocaltcp) {
 		TRACE(("leave newtcpdirect: local tcp forwarding disabled"));
@@ -240,6 +240,7 @@
 	snprintf(portstring, sizeof(portstring), "%d", destport);
 	sock = connect_remote(desthost, portstring, 1, NULL);
 	if (sock < 0) {
+		err = SSH_OPEN_CONNECT_FAILED;
 		TRACE(("leave newtcpdirect: sock failed"));
 		goto out;
 	}
@@ -253,13 +254,13 @@
 	channel->infd = sock;
 	channel->initconn = 1;
 	
-	ret = DROPBEAR_SUCCESS;
+	err = SSH_OPEN_IN_PROGRESS;
 
 out:
 	m_free(desthost);
 	m_free(orighost);
-	TRACE(("leave newtcpdirect: ret %d", ret));
-	return ret;
+	TRACE(("leave newtcpdirect: err %d", err));
+	return err;
 }
 
 #endif