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 <b.tonofa@ideco.ru>
OpenBSD-Commit-ID:
3e9d2252a4d0bd318d4f25e2b518afb44acea170
-/* $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 <djm@openbsd.org>
*
} 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";
}