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

Collapse All | Expand All

(-)channels.c (+21 lines)
Lines 2206-2211 Link Here
2206
	return success;
2206
	return success;
2207
}
2207
}
2208
2208
2209
int
2210
channel_cancel_rport_listener(const char *host, u_short port)
2211
{
2212
	int i, found = 0;
2213
2214
	for(i = 0; i < channels_alloc; i++) {
2215
		Channel *c = channels[i];
2216
2217
		/* XXX - ambiguity due to possible name truncation */
2218
		if (c != NULL && c->type == SSH_CHANNEL_RPORT_LISTENER && 
2219
		    strncmp(c->path, host, sizeof(c->path)) == 0 &&
2220
		    c->host_port == port) {
2221
			debug2("%s: close clannel %d", __func__, i);
2222
			channel_free(c);
2223
			found = 1;
2224
		}
2225
	}
2226
2227
	return (found);
2228
}
2229
2209
/* protocol local port fwd, used by ssh (and sshd in v1) */
2230
/* protocol local port fwd, used by ssh (and sshd in v1) */
2210
int
2231
int
2211
channel_setup_local_fwd_listener(u_short listen_port,
2232
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 990-995 Link Here
990
			    listen_address, listen_port, options.gateway_ports);
990
			    listen_address, listen_port, options.gateway_ports);
991
		}
991
		}
992
		xfree(listen_address);
992
		xfree(listen_address);
993
	} else if (strcmp(rtype, "cancel-tcpip-forward") == 0) {
994
		char *cancel_address;
995
		u_short cancel_port;
996
997
		cancel_address = packet_get_string(NULL);
998
		cancel_port = (u_short)packet_get_int();
999
		debug("server_input_global_request: cancel-tcpip-forward addr %s port %d",
1000
		    cancel_address, cancel_port);
1001
1002
		success = channel_cancel_rport_listener(cancel_address,
1003
		    cancel_port);
993
	}
1004
	}
994
	if (want_reply) {
1005
	if (want_reply) {
995
		packet_start(success ?
1006
		packet_start(success ?

Return to bug 756