comparison tcp-accept.c @ 259:c049490e43fe

* fix -L forwarding on the client, broke last rev
author Matt Johnston <matt@ucc.asn.au>
date Tue, 06 Dec 2005 16:51:55 +0000
parents 306499676384
children 3cea9d789cca
comparison
equal deleted inserted replaced
258:306499676384 259:c049490e43fe
63 NI_NUMERICHOST | NI_NUMERICSERV) != 0) { 63 NI_NUMERICHOST | NI_NUMERICSERV) != 0) {
64 return; 64 return;
65 } 65 }
66 66
67 if (send_msg_channel_open_init(fd, tcpinfo->chantype) == DROPBEAR_SUCCESS) { 67 if (send_msg_channel_open_init(fd, tcpinfo->chantype) == DROPBEAR_SUCCESS) {
68 unsigned char* addr = NULL;
69 unsigned int port = 0;
68 70
69 // address that was connected 71 if (tcpinfo->tcp_type == direct) {
70 buf_putstring(ses.writepayload, tcpinfo->listenaddr, 72 /* "direct-tcpip" */
71 strlen(tcpinfo->listenaddr)); 73 /* host to connect, port to connect */
72 // port that was connected 74 addr = tcpinfo->sendaddr;
73 buf_putint(ses.writepayload, tcpinfo->listenport); 75 port = tcpinfo->sendport;
74 // originator ip 76 } else {
77 dropbear_assert(tcpinfo->tcp_type == forwarded);
78 /* "forwarded-tcpip" */
79 /* address that was connected, port that was connected */
80 addr = tcpinfo->listenaddr;
81 port = tcpinfo->listenport;
82 }
83
84 buf_putstring(ses.writepayload, addr, strlen(addr));
85 buf_putint(ses.writepayload, port);
86
87 /* originator ip */
75 buf_putstring(ses.writepayload, ipstring, strlen(ipstring)); 88 buf_putstring(ses.writepayload, ipstring, strlen(ipstring));
76 // originator port 89 /* originator port */
77 buf_putint(ses.writepayload, atol(portstring)); 90 buf_putint(ses.writepayload, atol(portstring));
78 91
79 encrypt_packet(); 92 encrypt_packet();
80 93
81 } else { 94 } else {