comparison svr-tcpfwd.c @ 641:2b1bb792cd4d dropbear-tfm

- Update tfm changes to current default tip
author Matt Johnston <matt@ucc.asn.au>
date Mon, 21 Nov 2011 19:52:28 +0800
parents 79d48028457c
children c519b78b6d1a
comparison
equal deleted inserted replaced
640:76097ec1a29a 641:2b1bb792cd4d
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 || (strcmp(bindaddr, "localhost") == 0) ) {
214 // NULL means "localhost only"
215 m_free(bindaddr);
216 bindaddr = NULL;
217 }
218 tcpinfo->listenaddr = bindaddr;
213 219
214 ret = listen_tcpfwd(tcpinfo); 220 ret = listen_tcpfwd(tcpinfo);
215 221
216 out: 222 out:
217 if (ret == DROPBEAR_FAILURE) { 223 if (ret == DROPBEAR_FAILURE) {