diff tcp-accept.c @ 1620:572a7aefa188 bugfix

FIx remote forward listeners
author Matt Johnston <matt@ucc.asn.au>
date Fri, 07 Sep 2018 23:02:20 +0800
parents 58a74cb829b8
children 1d86a58fb52d
line wrap: on
line diff
--- a/tcp-accept.c	Thu Aug 23 23:59:24 2018 +0800
+++ b/tcp-accept.c	Fri Sep 07 23:02:20 2018 +0800
@@ -110,12 +110,12 @@
 	}
 }
 
-int listen_tcpfwd(struct TCPListener* tcpinfo) {
+int listen_tcpfwd(struct TCPListener* tcpinfo, struct Listener **ret_listener) {
 
 	char portstring[NI_MAXSERV];
 	int socks[DROPBEAR_MAX_SOCKS];
-	struct Listener *listener = NULL;
 	int nsocks;
+	struct Listener *listener;
 	char* errstring = NULL;
 
 	TRACE(("enter listen_tcpfwd"))
@@ -142,6 +142,10 @@
 		return DROPBEAR_FAILURE;
 	}
 
+	if (ret_listener) {
+		*ret_listener = listener;
+	}
+
 	TRACE(("leave listen_tcpfwd: success"))
 	return DROPBEAR_SUCCESS;
 }