diff options
author | djm@openbsd.org <djm@openbsd.org> | 2020-04-03 02:40:32 +0000 |
---|---|---|
committer | Damien Miller <djm@mindrot.org> | 2020-04-03 13:42:33 +1100 |
commit | 663e84bb53de2a60e56a44d538d25b8152b5c1cc (patch) | |
tree | 2b8a180730e1bd4e130f1af40800b0393beb818e /clientloop.c | |
parent | ed833da176611a39d3376d62154eb88eb440d31c (diff) |
upstream: make failures when establishing "Tunnel" forwarding terminate
the connection when ExitOnForwardFailure is enabled; bz3116; ok dtucker
OpenBSD-Commit-ID: ef4b4808de0a419c17579b1081da768625c1d735
Diffstat (limited to 'clientloop.c')
-rw-r--r-- | clientloop.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/clientloop.c b/clientloop.c index 5bfccdd35..8950f444b 100644 --- a/clientloop.c +++ b/clientloop.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: clientloop.c,v 1.342 2020/02/26 13:40:09 jsg Exp $ */ | 1 | /* $OpenBSD: clientloop.c,v 1.343 2020/04/03 02:40:32 djm Exp $ */ |
2 | /* | 2 | /* |
3 | * Author: Tatu Ylonen <ylo@cs.hut.fi> | 3 | * Author: Tatu Ylonen <ylo@cs.hut.fi> |
4 | * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland | 4 | * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland |
@@ -1645,7 +1645,7 @@ client_request_agent(struct ssh *ssh, const char *request_type, int rchan) | |||
1645 | 1645 | ||
1646 | char * | 1646 | char * |
1647 | client_request_tun_fwd(struct ssh *ssh, int tun_mode, | 1647 | client_request_tun_fwd(struct ssh *ssh, int tun_mode, |
1648 | int local_tun, int remote_tun) | 1648 | int local_tun, int remote_tun, channel_open_fn *cb, void *cbctx) |
1649 | { | 1649 | { |
1650 | Channel *c; | 1650 | Channel *c; |
1651 | int r, fd; | 1651 | int r, fd; |
@@ -1673,6 +1673,9 @@ client_request_tun_fwd(struct ssh *ssh, int tun_mode, | |||
1673 | sys_tun_outfilter, NULL, NULL); | 1673 | sys_tun_outfilter, NULL, NULL); |
1674 | #endif | 1674 | #endif |
1675 | 1675 | ||
1676 | if (cb != NULL) | ||
1677 | channel_register_open_confirm(ssh, c->self, cb, cbctx); | ||
1678 | |||
1676 | if ((r = sshpkt_start(ssh, SSH2_MSG_CHANNEL_OPEN)) != 0 || | 1679 | if ((r = sshpkt_start(ssh, SSH2_MSG_CHANNEL_OPEN)) != 0 || |
1677 | (r = sshpkt_put_cstring(ssh, "tun@openssh.com")) != 0 || | 1680 | (r = sshpkt_put_cstring(ssh, "tun@openssh.com")) != 0 || |
1678 | (r = sshpkt_put_u32(ssh, c->self)) != 0 || | 1681 | (r = sshpkt_put_u32(ssh, c->self)) != 0 || |