=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/ssh/channels.c,v retrieving revision 1.343 retrieving revision 1.344 diff -u -r1.343 -r1.344 --- src/usr.bin/ssh/channels.c 2015/05/08 03:25:07 1.343 +++ src/usr.bin/ssh/channels.c 2015/06/05 15:13:13 1.344 @@ -1,4 +1,4 @@ -/* $OpenBSD: channels.c,v 1.343 2015/05/08 03:25:07 dtucker Exp $ */ +/* $OpenBSD: channels.c,v 1.344 2015/06/05 15:13:13 millert Exp $ */ /* * Author: Tatu Ylonen * Copyright (c) 1995 Tatu Ylonen , Espoo, Finland @@ -2778,17 +2778,21 @@ char ntop[NI_MAXHOST], strport[NI_MAXSERV]; in_port_t *lport_p; - host = (type == SSH_CHANNEL_RPORT_LISTENER) ? - fwd->listen_host : fwd->connect_host; is_client = (type == SSH_CHANNEL_PORT_LISTENER); - if (host == NULL) { - error("No forward host name."); - return 0; - } - if (strlen(host) >= NI_MAXHOST) { - error("Forward host name too long."); - return 0; + if (is_client && fwd->connect_path != NULL) { + host = fwd->connect_path; + } else { + host = (type == SSH_CHANNEL_RPORT_LISTENER) ? + fwd->listen_host : fwd->connect_host; + if (host == NULL) { + error("No forward host name."); + return 0; + } + if (strlen(host) >= NI_MAXHOST) { + error("Forward host name too long."); + return 0; + } } /* Determine the bind address, cf. channel_fwd_bind_addr() comment */