summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--channels.c24
1 files changed, 14 insertions, 10 deletions
diff --git a/channels.c b/channels.c
index b0b1c58dd..45e1f9fcc 100644
--- a/channels.c
+++ b/channels.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: channels.c,v 1.343 2015/05/08 03:25:07 dtucker Exp $ */ 1/* $OpenBSD: channels.c,v 1.344 2015/06/05 15:13:13 millert 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
@@ -2805,17 +2805,21 @@ channel_setup_fwd_listener_tcpip(int type, struct Forward *fwd,
2805 char ntop[NI_MAXHOST], strport[NI_MAXSERV]; 2805 char ntop[NI_MAXHOST], strport[NI_MAXSERV];
2806 in_port_t *lport_p; 2806 in_port_t *lport_p;
2807 2807
2808 host = (type == SSH_CHANNEL_RPORT_LISTENER) ?
2809 fwd->listen_host : fwd->connect_host;
2810 is_client = (type == SSH_CHANNEL_PORT_LISTENER); 2808 is_client = (type == SSH_CHANNEL_PORT_LISTENER);
2811 2809
2812 if (host == NULL) { 2810 if (is_client && fwd->connect_path != NULL) {
2813 error("No forward host name."); 2811 host = fwd->connect_path;
2814 return 0; 2812 } else {
2815 } 2813 host = (type == SSH_CHANNEL_RPORT_LISTENER) ?
2816 if (strlen(host) >= NI_MAXHOST) { 2814 fwd->listen_host : fwd->connect_host;
2817 error("Forward host name too long."); 2815 if (host == NULL) {
2818 return 0; 2816 error("No forward host name.");
2817 return 0;
2818 }
2819 if (strlen(host) >= NI_MAXHOST) {
2820 error("Forward host name too long.");
2821 return 0;
2822 }
2819 } 2823 }
2820 2824
2821 /* Determine the bind address, cf. channel_fwd_bind_addr() comment */ 2825 /* Determine the bind address, cf. channel_fwd_bind_addr() comment */