version 1.312, 2011/09/09 22:46:44 |
version 1.313, 2011/09/10 22:26:34 |
|
|
|
|
int |
int |
channel_cancel_lport_listener(const char *lhost, u_short lport, |
channel_cancel_lport_listener(const char *lhost, u_short lport, |
u_short cport, int gateway_ports) |
int cport, int gateway_ports) |
{ |
{ |
u_int i; |
u_int i; |
int found = 0; |
int found = 0; |
|
|
Channel *c = channels[i]; |
Channel *c = channels[i]; |
if (c == NULL || c->type != SSH_CHANNEL_PORT_LISTENER) |
if (c == NULL || c->type != SSH_CHANNEL_PORT_LISTENER) |
continue; |
continue; |
if (c->listening_port != lport || c->host_port != cport) |
if (c->listening_port != lport) |
continue; |
continue; |
|
if (cport == CHANNEL_CANCEL_PORT_STATIC) { |
|
/* skip dynamic forwardings */ |
|
if (c->host_port == 0) |
|
continue; |
|
} else { |
|
if (c->host_port != cport) |
|
continue; |
|
} |
if ((c->listening_addr == NULL && addr != NULL) || |
if ((c->listening_addr == NULL && addr != NULL) || |
(c->listening_addr != NULL && addr == NULL)) |
(c->listening_addr != NULL && addr == NULL)) |
continue; |
continue; |