diff options
Diffstat (limited to 'channels.c')
-rw-r--r-- | channels.c | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/channels.c b/channels.c index 0f7e1a872..b6663de8f 100644 --- a/channels.c +++ b/channels.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: channels.c,v 1.312 2011/09/09 22:46:44 djm Exp $ */ | 1 | /* $OpenBSD: channels.c,v 1.313 2011/09/10 22:26:34 markus Exp $ */ |
2 | /* | 2 | /* |
3 | * Author: Tatu Ylonen <ylo@cs.hut.fi> | 3 | * Author: Tatu Ylonen <ylo@cs.hut.fi> |
4 | * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland | 4 | * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland |
@@ -2844,7 +2844,7 @@ channel_cancel_rport_listener(const char *host, u_short port) | |||
2844 | 2844 | ||
2845 | int | 2845 | int |
2846 | channel_cancel_lport_listener(const char *lhost, u_short lport, | 2846 | channel_cancel_lport_listener(const char *lhost, u_short lport, |
2847 | u_short cport, int gateway_ports) | 2847 | int cport, int gateway_ports) |
2848 | { | 2848 | { |
2849 | u_int i; | 2849 | u_int i; |
2850 | int found = 0; | 2850 | int found = 0; |
@@ -2854,8 +2854,16 @@ channel_cancel_lport_listener(const char *lhost, u_short lport, | |||
2854 | Channel *c = channels[i]; | 2854 | Channel *c = channels[i]; |
2855 | if (c == NULL || c->type != SSH_CHANNEL_PORT_LISTENER) | 2855 | if (c == NULL || c->type != SSH_CHANNEL_PORT_LISTENER) |
2856 | continue; | 2856 | continue; |
2857 | if (c->listening_port != lport || c->host_port != cport) | 2857 | if (c->listening_port != lport) |
2858 | continue; | 2858 | continue; |
2859 | if (cport == CHANNEL_CANCEL_PORT_STATIC) { | ||
2860 | /* skip dynamic forwardings */ | ||
2861 | if (c->host_port == 0) | ||
2862 | continue; | ||
2863 | } else { | ||
2864 | if (c->host_port != cport) | ||
2865 | continue; | ||
2866 | } | ||
2859 | if ((c->listening_addr == NULL && addr != NULL) || | 2867 | if ((c->listening_addr == NULL && addr != NULL) || |
2860 | (c->listening_addr != NULL && addr == NULL)) | 2868 | (c->listening_addr != NULL && addr == NULL)) |
2861 | continue; | 2869 | continue; |