Skip to content

Commit

Permalink
Fix build with DROPBEAR_SVR_LOCALTCPFWD=0, DROPBEAR_SVR_LOCALSTREAMFWD=1
Browse files Browse the repository at this point in the history
  • Loading branch information
mkj committed Apr 3, 2024
1 parent 796a89e commit 9b72921
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/runopts.h
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ typedef struct svr_runopts {
#if DROPBEAR_SVR_REMOTETCPFWD
int noremotetcp;
#endif
#if DROPBEAR_SVR_LOCALTCPFWD
#if DROPBEAR_SVR_LOCALANYFWD
int nolocaltcp;
#endif

Expand Down
6 changes: 3 additions & 3 deletions src/svr-runopts.c
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ static void printhelp(const char * progname) {
"-t Enable two-factor authentication (both password and public key required)\n"
#endif
"-T Maximum authentication tries (default %d)\n"
#if DROPBEAR_SVR_LOCALTCPFWD
#if DROPBEAR_SVR_LOCALANYFWD
"-j Disable local port forwarding\n"
#endif
#if DROPBEAR_SVR_REMOTETCPFWD
Expand Down Expand Up @@ -173,7 +173,7 @@ void svr_getopts(int argc, char ** argv) {
svr_opts.hostkey = NULL;
svr_opts.delay_hostkey = 0;
svr_opts.pidfile = expand_homedir_path(DROPBEAR_PIDFILE);
#if DROPBEAR_SVR_LOCALTCPFWD
#if DROPBEAR_SVR_LOCALANYFWD
svr_opts.nolocaltcp = 0;
#endif
#if DROPBEAR_SVR_REMOTETCPFWD
Expand Down Expand Up @@ -240,7 +240,7 @@ void svr_getopts(int argc, char ** argv) {
svr_opts.pass_on_env = 1;
break;

#if DROPBEAR_SVR_LOCALTCPFWD
#if DROPBEAR_SVR_LOCALANYFWD
case 'j':
svr_opts.nolocaltcp = 1;
break;
Expand Down
5 changes: 4 additions & 1 deletion src/sysoptions.h
Original file line number Diff line number Diff line change
Expand Up @@ -266,9 +266,12 @@

#define DROPBEAR_TCP_ACCEPT ((DROPBEAR_CLI_LOCALTCPFWD) || (DROPBEAR_SVR_REMOTETCPFWD))

/* TCP and stream local fwds share the same restrictions */
#define DROPBEAR_SVR_LOCALANYFWD ((DROPBEAR_SVR_LOCALTCPFWD) || (DROPBEAR_SVR_LOCALSTREAMFWD))

#define DROPBEAR_LISTENERS \
((DROPBEAR_CLI_REMOTETCPFWD) || (DROPBEAR_CLI_LOCALTCPFWD) || \
(DROPBEAR_SVR_REMOTETCPFWD) || (DROPBEAR_SVR_LOCALTCPFWD) || \
(DROPBEAR_SVR_REMOTETCPFWD) || (DROPBEAR_SVR_LOCALANYFWD) || \
(DROPBEAR_SVR_AGENTFWD) || (DROPBEAR_X11FWD))

#define DROPBEAR_CLI_MULTIHOP ((DROPBEAR_CLI_NETCAT) && (DROPBEAR_CLI_PROXYCMD))
Expand Down

0 comments on commit 9b72921

Please sign in to comment.