summaryrefslogtreecommitdiffhomepage
path: root/cli-tcpfwd.c
diff options
context:
space:
mode:
Diffstat (limited to 'cli-tcpfwd.c')
-rw-r--r--cli-tcpfwd.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/cli-tcpfwd.c b/cli-tcpfwd.c
index 03b4b92..78f61f7 100644
--- a/cli-tcpfwd.c
+++ b/cli-tcpfwd.c
@@ -32,7 +32,7 @@
#include "ssh.h"
#include "netio.h"
-#ifdef ENABLE_CLI_REMOTETCPFWD
+#if DROPBEAR_CLI_REMOTETCPFWD
static int newtcpforwarded(struct Channel * channel);
const struct ChanType cli_chan_tcpremote = {
@@ -45,7 +45,7 @@ const struct ChanType cli_chan_tcpremote = {
};
#endif
-#ifdef ENABLE_CLI_LOCALTCPFWD
+#if DROPBEAR_CLI_LOCALTCPFWD
static int cli_localtcp(const char* listenaddr,
unsigned int listenport,
const char* remoteaddr,
@@ -60,7 +60,7 @@ static const struct ChanType cli_chan_tcplocal = {
};
#endif
-#ifdef ENABLE_CLI_ANYTCPFWD
+#if DROPBEAR_CLI_ANYTCPFWD
static void fwd_failed(const char* format, ...) ATTRIB_PRINTF(1,2);
static void fwd_failed(const char* format, ...)
{
@@ -77,7 +77,7 @@ static void fwd_failed(const char* format, ...)
}
#endif
-#ifdef ENABLE_CLI_LOCALTCPFWD
+#if DROPBEAR_CLI_LOCALTCPFWD
void setup_localtcp() {
m_list_elem *iter;
int ret;
@@ -144,9 +144,9 @@ static int cli_localtcp(const char* listenaddr,
TRACE(("leave cli_localtcp: %d", ret))
return ret;
}
-#endif /* ENABLE_CLI_LOCALTCPFWD */
+#endif /* DROPBEAR_CLI_LOCALTCPFWD */
-#ifdef ENABLE_CLI_REMOTETCPFWD
+#if DROPBEAR_CLI_REMOTETCPFWD
static void send_msg_global_request_remotetcp(const char *addr, int port) {
TRACE(("enter send_msg_global_request_remotetcp"))
@@ -234,7 +234,7 @@ static int newtcpforwarded(struct Channel * channel) {
char *origaddr = NULL;
unsigned int origport;
m_list_elem * iter = NULL;
- struct TCPFwdEntry *fwd;
+ struct TCPFwdEntry *fwd = NULL;
char portstring[NI_MAXSERV];
int err = SSH_OPEN_ADMINISTRATIVELY_PROHIBITED;
@@ -265,7 +265,7 @@ static int newtcpforwarded(struct Channel * channel) {
}
- if (iter == NULL) {
+ if (iter == NULL || fwd == NULL) {
/* We didn't request forwarding on that port */
cleantext(origaddr);
dropbear_log(LOG_INFO, "Server sent unrequested forward from \"%s:%d\"",
@@ -285,4 +285,4 @@ out:
TRACE(("leave newtcpdirect: err %d", err))
return err;
}
-#endif /* ENABLE_CLI_REMOTETCPFWD */
+#endif /* DROPBEAR_CLI_REMOTETCPFWD */