comparison tcp-accept.c @ 675:dfdb9d9189ff

Server shouldn't return "localhost" in response to -R forward connections if that wasn't what the client requested.
author Matt Johnston <matt@ucc.asn.au>
date Wed, 09 May 2012 21:09:34 +0800
parents abf040aedd44
children 5daedffd0769
comparison
equal deleted inserted replaced
674:1291413c7c7e 675:dfdb9d9189ff
38 38
39 struct TCPListener *tcpinfo = (struct TCPListener*)(listener->typedata); 39 struct TCPListener *tcpinfo = (struct TCPListener*)(listener->typedata);
40 40
41 m_free(tcpinfo->sendaddr); 41 m_free(tcpinfo->sendaddr);
42 m_free(tcpinfo->listenaddr); 42 m_free(tcpinfo->listenaddr);
43 m_free(tcpinfo->request_listenaddr);
43 m_free(tcpinfo); 44 m_free(tcpinfo);
44 } 45 }
45 46
46 static void tcp_acceptor(struct Listener *listener, int sock) { 47 static void tcp_acceptor(struct Listener *listener, int sock) {
47 48
76 port = tcpinfo->sendport; 77 port = tcpinfo->sendport;
77 } else { 78 } else {
78 dropbear_assert(tcpinfo->tcp_type == forwarded); 79 dropbear_assert(tcpinfo->tcp_type == forwarded);
79 /* "forwarded-tcpip" */ 80 /* "forwarded-tcpip" */
80 /* address that was connected, port that was connected */ 81 /* address that was connected, port that was connected */
81 addr = tcpinfo->listenaddr; 82 addr = tcpinfo->request_listenaddr;
82 port = tcpinfo->listenport; 83 port = tcpinfo->listenport;
83 } 84 }
84 85
85 if (addr == NULL) { 86 if (addr == NULL) {
86 addr = "localhost"; 87 addr = "localhost";