Skip to content

Commit

Permalink
src: svr-tcpfwd: Fix noremotetcp behavior
Browse files Browse the repository at this point in the history
If noremotetcp is set, we should still reply with
send_msg_request_failed. This matches the behavior
of !DROPBEAR_SVR_REMOTETCPFWD.

We were seeing keepalive packets being ignored when
the "-k" option was used.
  • Loading branch information
Ryceancurry authored and mkj committed Dec 6, 2023
1 parent 9925b00 commit 3cf8344
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/svr-tcpfwd.c
Original file line number Diff line number Diff line change
Expand Up @@ -79,14 +79,14 @@ void recv_msg_global_request_remotetcp() {

TRACE(("enter recv_msg_global_request_remotetcp"))

reqname = buf_getstring(ses.payload, &namelen);
wantreply = buf_getbool(ses.payload);

if (svr_opts.noremotetcp || !svr_pubkey_allows_tcpfwd()) {
TRACE(("leave recv_msg_global_request_remotetcp: remote tcp forwarding disabled"))
goto out;
}

reqname = buf_getstring(ses.payload, &namelen);
wantreply = buf_getbool(ses.payload);

if (namelen > MAX_NAME_LEN) {
TRACE(("name len is wrong: %d", namelen))
goto out;
Expand Down

0 comments on commit 3cf8344

Please sign in to comment.