Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Matt Johnston
dropbear
Commits
6c56271e
Commit
6c56271e
authored
Dec 06, 2005
by
Matt Johnston
Browse files
* fix -L forwarding on the client, broke last rev
--HG-- extra : convert_revision : 826db75f8001f7da7b0b8c91dcf66a44bf107b49
parent
a673d609
Changes
4
Hide whitespace changes
Inline
Side-by-side
cli-tcpfwd.c
View file @
6c56271e
...
...
@@ -107,6 +107,7 @@ static int cli_localtcp(unsigned int listenport, const char* remoteaddr,
tcpinfo
->
listenport
=
listenport
;
tcpinfo
->
chantype
=
&
cli_chan_tcplocal
;
tcpinfo
->
tcp_type
=
direct
;
ret
=
listen_tcpfwd
(
tcpinfo
);
...
...
svr-tcpfwd.c
View file @
6c56271e
...
...
@@ -208,6 +208,7 @@ static int svr_remotetcpreq() {
tcpinfo
->
listenaddr
=
bindaddr
;
tcpinfo
->
listenport
=
port
;
tcpinfo
->
chantype
=
&
svr_chan_tcpremote
;
tcpinfo
->
tcp_type
=
forwarded
;
ret
=
listen_tcpfwd
(
tcpinfo
);
...
...
tcp-accept.c
View file @
6c56271e
...
...
@@ -65,15 +65,28 @@ static void tcp_acceptor(struct Listener *listener, int sock) {
}
if
(
send_msg_channel_open_init
(
fd
,
tcpinfo
->
chantype
)
==
DROPBEAR_SUCCESS
)
{
// address that was connected
buf_putstring
(
ses
.
writepayload
,
tcpinfo
->
listenaddr
,
strlen
(
tcpinfo
->
listenaddr
));
// port that was connected
buf_putint
(
ses
.
writepayload
,
tcpinfo
->
listenport
);
// originator ip
unsigned
char
*
addr
=
NULL
;
unsigned
int
port
=
0
;
if
(
tcpinfo
->
tcp_type
==
direct
)
{
/* "direct-tcpip" */
/* host to connect, port to connect */
addr
=
tcpinfo
->
sendaddr
;
port
=
tcpinfo
->
sendport
;
}
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
));
/
/
originator port
/
*
originator port
*/
buf_putint
(
ses
.
writepayload
,
atol
(
portstring
));
encrypt_packet
();
...
...
tcpfwd.h
View file @
6c56271e
...
...
@@ -40,7 +40,7 @@ struct TCPListener {
unsigned
int
listenport
;
const
struct
ChanType
*
chantype
;
enum
{
direct
,
forwarded
}
tcp_type
;
};
/* A link in a list of forwards */
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment