- Progress for allowing specifying a listenaddr for tcp forwards

--HG--
extra : convert_revision : 48fdaa8706d1acda35e9d564adc9a1fbc96c18c8
This commit is contained in:
Matt Johnston
2010-02-24 16:13:15 +00:00
parent 3dbc707820
commit 85288d7b61
5 changed files with 88 additions and 45 deletions

View File

@@ -206,11 +206,20 @@ static int svr_remotetcpreq() {
tcpinfo = (struct TCPListener*)m_malloc(sizeof(struct TCPListener));
tcpinfo->sendaddr = NULL;
tcpinfo->sendport = 0;
tcpinfo->listenaddr = bindaddr;
tcpinfo->listenport = port;
tcpinfo->chantype = &svr_chan_tcpremote;
tcpinfo->tcp_type = forwarded;
if (!opts.listen_fwd_all
|| (strcmp(tcpinfo->listenaddr, "localhost") == 0) ) {
// NULL means "localhost only"
tcpinfo->listenaddr = NULL;
}
else
{
tcpinfo->listenaddr = bindaddr;
}
ret = listen_tcpfwd(tcpinfo);
out: