diff --git a/cli-chansession.c b/cli-chansession.c
index 2d97fea1fbd30626a1c7262220deae9dbf848008..49b4e06add4e3ad74f478a21807da3af73b22189 100644
--- a/cli-chansession.c
+++ b/cli-chansession.c
@@ -381,20 +381,20 @@ static int cli_initchansess(struct Channel *channel) {
 
 #ifdef ENABLE_CLI_NETCAT
 
+const struct ChanType cli_chan_netcat = {
+	0, /* sepfds */
+	"direct-tcpip",
+	cli_init_stdpipe_sess, /* inithandler */
+	NULL,
+	NULL,
+	cli_closechansess
+};
+
 void cli_send_netcat_request() {
 
 	const unsigned char* source_host = "127.0.0.1";
 	const int source_port = 22;
 
-	const struct ChanType cli_chan_netcat = {
-		0, /* sepfds */
-		"direct-tcpip",
-		cli_init_stdpipe_sess, /* inithandler */
-		NULL,
-		NULL,
-		cli_closechansess
-	};
-
 	cli_opts.wantpty = 0;
 
 	if (send_msg_channel_open_init(STDIN_FILENO, &cli_chan_netcat)