diff svr-tcpfwd.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 2c902644036d
children 79eef94ccea9
line wrap: on
line diff
--- a/svr-tcpfwd.c	Thu Aug 23 23:59:24 2018 +0800
+++ b/svr-tcpfwd.c	Fri Sep 07 23:02:20 2018 +0800
@@ -168,6 +168,7 @@
 	unsigned int addrlen;
 	struct TCPListener *tcpinfo = NULL;
 	unsigned int port;
+	struct Listener *listener = NULL;
 
 	TRACE(("enter remotetcpreq"))
 
@@ -208,9 +209,9 @@
 		tcpinfo->listenaddr = m_strdup(request_addr);
 	}
 
-	ret = listen_tcpfwd(tcpinfo);
+	ret = listen_tcpfwd(tcpinfo, &listener);
 	if (DROPBEAR_SUCCESS == ret) {
-		tcpinfo->listenport = get_sock_port(ses.listeners[0]->socks[0]);
+		tcpinfo->listenport = get_sock_port(listener->socks[0]);
 		*allocated_listen_port = tcpinfo->listenport;
 	}