View | Details | Raw Unified | Return to bug 215
Collapse All | Expand All

(-)channels.c (-1 / +1 lines)
Lines 2126-2132 Link Here
2126
		const char *address_to_bind = "0.0.0.0";
2126
		const char *address_to_bind = "0.0.0.0";
2127
		packet_start(SSH2_MSG_GLOBAL_REQUEST);
2127
		packet_start(SSH2_MSG_GLOBAL_REQUEST);
2128
		packet_put_cstring("tcpip-forward");
2128
		packet_put_cstring("tcpip-forward");
2129
		packet_put_char(0);			/* boolean: want reply */
2129
		packet_put_char(1);			/* boolean: want reply */
2130
		packet_put_cstring(address_to_bind);
2130
		packet_put_cstring(address_to_bind);
2131
		packet_put_int(listen_port);
2131
		packet_put_int(listen_port);
2132
		packet_send();
2132
		packet_send();
(-)clientloop.c (+5 lines)
Lines 1314-1319 Link Here
1314
client_init_dispatch_20(void)
1314
client_init_dispatch_20(void)
1315
{
1315
{
1316
	dispatch_init(&dispatch_protocol_error);
1316
	dispatch_init(&dispatch_protocol_error);
1317
1317
	dispatch_set(SSH2_MSG_CHANNEL_CLOSE, &channel_input_oclose);
1318
	dispatch_set(SSH2_MSG_CHANNEL_CLOSE, &channel_input_oclose);
1318
	dispatch_set(SSH2_MSG_CHANNEL_DATA, &channel_input_data);
1319
	dispatch_set(SSH2_MSG_CHANNEL_DATA, &channel_input_data);
1319
	dispatch_set(SSH2_MSG_CHANNEL_EOF, &channel_input_ieof);
1320
	dispatch_set(SSH2_MSG_CHANNEL_EOF, &channel_input_ieof);
Lines 1327-1332 Link Here
1327
1328
1328
	/* rekeying */
1329
	/* rekeying */
1329
	dispatch_set(SSH2_MSG_KEXINIT, &kex_input_kexinit);
1330
	dispatch_set(SSH2_MSG_KEXINIT, &kex_input_kexinit);
1331
1332
	/* global request reply messages */
1333
	dispatch_set(SSH2_MSG_REQUEST_FAILURE, &client_global_request_reply);
1334
	dispatch_set(SSH2_MSG_REQUEST_SUCCESS, &client_global_request_reply);
1330
}
1335
}
1331
static void
1336
static void
1332
client_init_dispatch_13(void)
1337
client_init_dispatch_13(void)
(-)clientloop.h (+1 lines)
Lines 37-39 Link Here
37
37
38
/* Client side main loop for the interactive session. */
38
/* Client side main loop for the interactive session. */
39
int	 client_loop(int, int, int);
39
int	 client_loop(int, int, int);
40
void	 client_global_request_reply(int type, u_int32_t seq, void *ctxt);
(-)ssh.c (+24 lines)
Lines 138-143 Link Here
138
/* Should we execute a command or invoke a subsystem? */
138
/* Should we execute a command or invoke a subsystem? */
139
int subsystem_flag = 0;
139
int subsystem_flag = 0;
140
140
141
/* # of replies received for global requests */
142
static int client_global_request_id = 0;
143
141
/* Prints a help message to the user.  This function never returns. */
144
/* Prints a help message to the user.  This function never returns. */
142
145
143
static void
146
static void
Lines 1019-1024 Link Here
1019
	if (type == SSH2_MSG_CHANNEL_FAILURE)
1022
	if (type == SSH2_MSG_CHANNEL_FAILURE)
1020
		fatal("Request for subsystem '%.*s' failed on channel %d",
1023
		fatal("Request for subsystem '%.*s' failed on channel %d",
1021
		    len, (u_char *)buffer_ptr(&command), id);
1024
		    len, (u_char *)buffer_ptr(&command), id);
1025
}
1026
1027
void
1028
client_global_request_reply(int type, u_int32_t seq, void *ctxt)
1029
{
1030
	int i;
1031
1032
	i = client_global_request_id++;
1033
	if (i >= options.num_remote_forwards) {
1034
		error("client_global_request_reply: too many replies %d > %d",
1035
		    i, options.num_remote_forwards);
1036
		return;
1037
	}
1038
	debug("remote forward %s for: listen %d, connect %s:%d",
1039
	    type == SSH2_MSG_REQUEST_SUCCESS ? "success" : "failure",
1040
	    options.remote_forwards[i].port,
1041
	    options.remote_forwards[i].host,
1042
	    options.remote_forwards[i].host_port);
1043
	if (type == SSH2_MSG_REQUEST_FAILURE)
1044
		log("Warning: remote port forwarding failed for listen port %d",
1045
		    options.remote_forwards[i].port);
1022
}
1046
}
1023
1047
1024
/* request pty/x11/agent/tcpfwd/shell for channel */
1048
/* request pty/x11/agent/tcpfwd/shell for channel */

Return to bug 215