Mercurial > dropbear
diff tcp-accept.c @ 577:69e98c45db7c
- Progress for allowing specifying a listenaddr for tcp forwards
author | Matt Johnston <matt@ucc.asn.au> |
---|---|
date | Wed, 24 Feb 2010 16:13:15 +0000 |
parents | c216212001fc |
children | d2daeb015138 |
line wrap: on
line diff
--- a/tcp-accept.c Wed Nov 12 13:13:00 2008 +0000 +++ b/tcp-accept.c Wed Feb 24 16:13:15 2010 +0000 @@ -104,21 +104,13 @@ struct Listener *listener = NULL; int nsocks; char* errstring = NULL; - /* listen_spec = NULL indicates localhost */ - const char* listen_spec = NULL; TRACE(("enter listen_tcpfwd")) /* first we try to bind, so don't need to do so much cleanup on failure */ snprintf(portstring, sizeof(portstring), "%d", tcpinfo->listenport); - /* a listenaddr of "" will indicate all interfaces */ - if (opts.listen_fwd_all - && (strcmp(tcpinfo->listenaddr, "localhost") != 0) ) { - listen_spec = tcpinfo->listenaddr; - } - - nsocks = dropbear_listen(listen_spec, portstring, socks, + nsocks = dropbear_listen(tcpinfo->listenaddr, portstring, socks, DROPBEAR_MAX_SOCKS, &errstring, &ses.maxfd); if (nsocks < 0) { dropbear_log(LOG_INFO, "TCP forward failed: %s", errstring);