From bcc2ac6393debd59e174402b7b05e6b9ec5cf662 Mon Sep 17 00:00:00 2001 From: Damien Miller Date: Wed, 2 Jan 2013 00:32:08 +0000 Subject: channel_setup_local_fwd_listener() returns 0 on failure, not -ve bz#2055 reported by mathieu.lacage AT gmail.com --- usr.bin/ssh/clientloop.c | 6 +++--- usr.bin/ssh/mux.c | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) (limited to 'usr.bin') diff --git a/usr.bin/ssh/clientloop.c b/usr.bin/ssh/clientloop.c index d7ec61db7d2..48da1e9b601 100644 --- a/usr.bin/ssh/clientloop.c +++ b/usr.bin/ssh/clientloop.c @@ -1,4 +1,4 @@ -/* $OpenBSD: clientloop.c,v 1.247 2012/09/07 06:34:21 dtucker Exp $ */ +/* $OpenBSD: clientloop.c,v 1.248 2013/01/02 00:32:07 djm Exp $ */ /* * Author: Tatu Ylonen * Copyright (c) 1995 Tatu Ylonen , Espoo, Finland @@ -959,9 +959,9 @@ process_cmdline(void) goto out; } if (local || dynamic) { - if (channel_setup_local_fwd_listener(fwd.listen_host, + if (!channel_setup_local_fwd_listener(fwd.listen_host, fwd.listen_port, fwd.connect_host, - fwd.connect_port, options.gateway_ports) < 0) { + fwd.connect_port, options.gateway_ports)) { logit("Port forwarding failed."); goto out; } diff --git a/usr.bin/ssh/mux.c b/usr.bin/ssh/mux.c index 57b28a1fd75..2983eb0f7f1 100644 --- a/usr.bin/ssh/mux.c +++ b/usr.bin/ssh/mux.c @@ -1,4 +1,4 @@ -/* $OpenBSD: mux.c,v 1.37 2012/08/17 00:45:45 dtucker Exp $ */ +/* $OpenBSD: mux.c,v 1.38 2013/01/02 00:32:07 djm Exp $ */ /* * Copyright (c) 2002-2008 Damien Miller * @@ -721,9 +721,9 @@ process_mux_open_fwd(u_int rid, Channel *c, Buffer *m, Buffer *r) } if (ftype == MUX_FWD_LOCAL || ftype == MUX_FWD_DYNAMIC) { - if (channel_setup_local_fwd_listener(fwd.listen_host, + if (!channel_setup_local_fwd_listener(fwd.listen_host, fwd.listen_port, fwd.connect_host, fwd.connect_port, - options.gateway_ports) < 0) { + options.gateway_ports)) { fail: logit("slave-requested %s failed", fwd_desc); buffer_put_int(r, MUX_S_FAILURE); -- cgit v1.2.3