From 663e84bb53de2a60e56a44d538d25b8152b5c1cc Mon Sep 17 00:00:00 2001 From: "djm@openbsd.org" Date: Fri, 3 Apr 2020 02:40:32 +0000 Subject: upstream: make failures when establishing "Tunnel" forwarding terminate the connection when ExitOnForwardFailure is enabled; bz3116; ok dtucker OpenBSD-Commit-ID: ef4b4808de0a419c17579b1081da768625c1d735 --- clientloop.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'clientloop.c') diff --git a/clientloop.c b/clientloop.c index 5bfccdd35..8950f444b 100644 --- a/clientloop.c +++ b/clientloop.c @@ -1,4 +1,4 @@ -/* $OpenBSD: clientloop.c,v 1.342 2020/02/26 13:40:09 jsg Exp $ */ +/* $OpenBSD: clientloop.c,v 1.343 2020/04/03 02:40:32 djm Exp $ */ /* * Author: Tatu Ylonen * Copyright (c) 1995 Tatu Ylonen , Espoo, Finland @@ -1645,7 +1645,7 @@ client_request_agent(struct ssh *ssh, const char *request_type, int rchan) char * client_request_tun_fwd(struct ssh *ssh, int tun_mode, - int local_tun, int remote_tun) + int local_tun, int remote_tun, channel_open_fn *cb, void *cbctx) { Channel *c; int r, fd; @@ -1673,6 +1673,9 @@ client_request_tun_fwd(struct ssh *ssh, int tun_mode, sys_tun_outfilter, NULL, NULL); #endif + if (cb != NULL) + channel_register_open_confirm(ssh, c->self, cb, cbctx); + if ((r = sshpkt_start(ssh, SSH2_MSG_CHANNEL_OPEN)) != 0 || (r = sshpkt_put_cstring(ssh, "tun@openssh.com")) != 0 || (r = sshpkt_put_u32(ssh, c->self)) != 0 || -- cgit v1.2.3