From: djm@openbsd.org Date: Fri, 4 Jul 2025 00:17:55 +0000 (+0000) Subject: upstream: mux: fix incorrect return value check in local forward X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=fd10cea0f16e928ae2b52fbeadccd475d0438eb4;p=thirdparty%2Fopenssh-portable.git upstream: mux: fix incorrect return value check in local forward cancellation channel_cancel_lport_listener() returns 1 on success and 0 on failure. The previous code incorrectly checked for `== -1`, a value the function never returns, so failure was not detected and the "port not found" error message was never shown when cancelling dynamic or local port forwards. From: Boris Tonofa OpenBSD-Commit-ID: 3e9d2252a4d0bd318d4f25e2b518afb44acea170 --- diff --git a/mux.c b/mux.c index 415024f74..1a4f357d4 100644 --- a/mux.c +++ b/mux.c @@ -1,4 +1,4 @@ -/* $OpenBSD: mux.c,v 1.103 2024/10/12 10:50:37 jsg Exp $ */ +/* $OpenBSD: mux.c,v 1.104 2025/07/04 00:17:55 djm Exp $ */ /* * Copyright (c) 2002-2008 Damien Miller * @@ -931,7 +931,7 @@ mux_master_process_close_fwd(struct ssh *ssh, u_int rid, } else { /* local and dynamic forwards */ /* Ditto */ if (channel_cancel_lport_listener(ssh, &fwd, fwd.connect_port, - &options.fwd_opts) == -1) + &options.fwd_opts) != 1) error_reason = "port not found"; }