View | Details | Raw Unified | Return to bug 756 | Differences between
and this patch

Collapse All | Expand All

(-)channels.c (+23 lines)
Lines 2218-2223 Link Here
2218
	return success;
2218
	return success;
2219
}
2219
}
2220
2220
2221
int
2222
channel_cancel_rport_listener(const char *host, u_short port)
2223
{
2224
	int i, found = 0;
2225
2226
	for(i = 0; i < channels_alloc; i++) {
2227
		Channel *c = channels[i];
2228
2229
		if (c != NULL && c->type == SSH_CHANNEL_RPORT_LISTENER) {
2230
			debug3("Channel %d %s:%d vs close msg %s:%d", 
2231
			    c->self, c->path, c->host_port, host, port);
2232
			if (strncmp(c->path, host, sizeof(c->path)) == 0 &&
2233
		    	    c->host_port == port) {
2234
				debug2("%s: close clannel %d", __func__, i);
2235
				channel_free(c);
2236
				found = 1;
2237
			}
2238
		}
2239
	}
2240
2241
	return (found);
2242
}
2243
2221
/* protocol local port fwd, used by ssh (and sshd in v1) */
2244
/* protocol local port fwd, used by ssh (and sshd in v1) */
2222
int
2245
int
2223
channel_setup_local_fwd_listener(u_short listen_port,
2246
channel_setup_local_fwd_listener(u_short listen_port,
(-)channels.h (+1 lines)
Lines 201-206 Link Here
201
void	 channel_request_remote_forwarding(u_short, const char *, u_short);
201
void	 channel_request_remote_forwarding(u_short, const char *, u_short);
202
int	 channel_setup_local_fwd_listener(u_short, const char *, u_short, int);
202
int	 channel_setup_local_fwd_listener(u_short, const char *, u_short, int);
203
int	 channel_setup_remote_fwd_listener(const char *, u_short, int);
203
int	 channel_setup_remote_fwd_listener(const char *, u_short, int);
204
int	 channel_cancel_rport_listener(const char *, u_short);
204
205
205
/* x11 forwarding */
206
/* x11 forwarding */
206
207
(-)serverloop.c (+11 lines)
Lines 986-991 Link Here
986
			    listen_address, listen_port, options.gateway_ports);
986
			    listen_address, listen_port, options.gateway_ports);
987
		}
987
		}
988
		xfree(listen_address);
988
		xfree(listen_address);
989
	} else if (strcmp(rtype, "cancel-tcpip-forward") == 0) {
990
		char *cancel_address;
991
		u_short cancel_port;
992
993
		cancel_address = packet_get_string(NULL);
994
		cancel_port = (u_short)packet_get_int();
995
		debug("server_input_global_request: cancel-tcpip-forward addr %s port %d",
996
		    cancel_address, cancel_port);
997
998
		success = channel_cancel_rport_listener(cancel_address,
999
		    cancel_port);
989
	}
1000
	}
990
	if (want_reply) {
1001
	if (want_reply) {
991
		packet_start(success ?
1002
		packet_start(success ?

Return to bug 756