mirror of
https://github.com/clearml/dropbear
synced 2025-06-23 02:06:55 +00:00
* fix -L forwarding on the client, broke last rev
--HG-- extra : convert_revision : 826db75f8001f7da7b0b8c91dcf66a44bf107b49
This commit is contained in:
parent
a673d60963
commit
6c56271e8c
@ -107,6 +107,7 @@ static int cli_localtcp(unsigned int listenport, const char* remoteaddr,
|
|||||||
tcpinfo->listenport = listenport;
|
tcpinfo->listenport = listenport;
|
||||||
|
|
||||||
tcpinfo->chantype = &cli_chan_tcplocal;
|
tcpinfo->chantype = &cli_chan_tcplocal;
|
||||||
|
tcpinfo->tcp_type = direct;
|
||||||
|
|
||||||
ret = listen_tcpfwd(tcpinfo);
|
ret = listen_tcpfwd(tcpinfo);
|
||||||
|
|
||||||
|
@ -208,6 +208,7 @@ static int svr_remotetcpreq() {
|
|||||||
tcpinfo->listenaddr = bindaddr;
|
tcpinfo->listenaddr = bindaddr;
|
||||||
tcpinfo->listenport = port;
|
tcpinfo->listenport = port;
|
||||||
tcpinfo->chantype = &svr_chan_tcpremote;
|
tcpinfo->chantype = &svr_chan_tcpremote;
|
||||||
|
tcpinfo->tcp_type = forwarded;
|
||||||
|
|
||||||
ret = listen_tcpfwd(tcpinfo);
|
ret = listen_tcpfwd(tcpinfo);
|
||||||
|
|
||||||
|
27
tcp-accept.c
27
tcp-accept.c
@ -65,15 +65,28 @@ static void tcp_acceptor(struct Listener *listener, int sock) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (send_msg_channel_open_init(fd, tcpinfo->chantype) == DROPBEAR_SUCCESS) {
|
if (send_msg_channel_open_init(fd, tcpinfo->chantype) == DROPBEAR_SUCCESS) {
|
||||||
|
unsigned char* addr = NULL;
|
||||||
|
unsigned int port = 0;
|
||||||
|
|
||||||
// address that was connected
|
if (tcpinfo->tcp_type == direct) {
|
||||||
buf_putstring(ses.writepayload, tcpinfo->listenaddr,
|
/* "direct-tcpip" */
|
||||||
strlen(tcpinfo->listenaddr));
|
/* host to connect, port to connect */
|
||||||
// port that was connected
|
addr = tcpinfo->sendaddr;
|
||||||
buf_putint(ses.writepayload, tcpinfo->listenport);
|
port = tcpinfo->sendport;
|
||||||
// originator ip
|
} else {
|
||||||
|
dropbear_assert(tcpinfo->tcp_type == forwarded);
|
||||||
|
/* "forwarded-tcpip" */
|
||||||
|
/* address that was connected, port that was connected */
|
||||||
|
addr = tcpinfo->listenaddr;
|
||||||
|
port = tcpinfo->listenport;
|
||||||
|
}
|
||||||
|
|
||||||
|
buf_putstring(ses.writepayload, addr, strlen(addr));
|
||||||
|
buf_putint(ses.writepayload, port);
|
||||||
|
|
||||||
|
/* originator ip */
|
||||||
buf_putstring(ses.writepayload, ipstring, strlen(ipstring));
|
buf_putstring(ses.writepayload, ipstring, strlen(ipstring));
|
||||||
// originator port
|
/* originator port */
|
||||||
buf_putint(ses.writepayload, atol(portstring));
|
buf_putint(ses.writepayload, atol(portstring));
|
||||||
|
|
||||||
encrypt_packet();
|
encrypt_packet();
|
||||||
|
Loading…
Reference in New Issue
Block a user