summaryrefslogtreecommitdiffhomepage
path: root/tcp-accept.c
diff options
context:
space:
mode:
Diffstat (limited to 'tcp-accept.c')
-rw-r--r--tcp-accept.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/tcp-accept.c b/tcp-accept.c
index 18cd8c6..6578d71 100644
--- a/tcp-accept.c
+++ b/tcp-accept.c
@@ -110,12 +110,12 @@ static void tcp_acceptor(const struct Listener *listener, int sock) {
}
}
-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 @@ int listen_tcpfwd(struct TCPListener* tcpinfo) {
return DROPBEAR_FAILURE;
}
+ if (ret_listener) {
+ *ret_listener = listener;
+ }
+
TRACE(("leave listen_tcpfwd: success"))
return DROPBEAR_SUCCESS;
}