comparison svr-tcpfwd.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 52a644e7b8e1
children 35d27c1d0ee7
comparison
equal deleted inserted replaced
518:ce104c8b0be1 577:69e98c45db7c
204 } 204 }
205 205
206 tcpinfo = (struct TCPListener*)m_malloc(sizeof(struct TCPListener)); 206 tcpinfo = (struct TCPListener*)m_malloc(sizeof(struct TCPListener));
207 tcpinfo->sendaddr = NULL; 207 tcpinfo->sendaddr = NULL;
208 tcpinfo->sendport = 0; 208 tcpinfo->sendport = 0;
209 tcpinfo->listenaddr = bindaddr;
210 tcpinfo->listenport = port; 209 tcpinfo->listenport = port;
211 tcpinfo->chantype = &svr_chan_tcpremote; 210 tcpinfo->chantype = &svr_chan_tcpremote;
212 tcpinfo->tcp_type = forwarded; 211 tcpinfo->tcp_type = forwarded;
212
213 if (!opts.listen_fwd_all
214 || (strcmp(tcpinfo->listenaddr, "localhost") == 0) ) {
215 // NULL means "localhost only"
216 tcpinfo->listenaddr = NULL;
217 }
218 else
219 {
220 tcpinfo->listenaddr = bindaddr;
221 }
213 222
214 ret = listen_tcpfwd(tcpinfo); 223 ret = listen_tcpfwd(tcpinfo);
215 224
216 out: 225 out:
217 if (ret == DROPBEAR_FAILURE) { 226 if (ret == DROPBEAR_FAILURE) {