diff options
Diffstat (limited to 'mux.c')
-rw-r--r-- | mux.c | 12 |
1 files changed, 4 insertions, 8 deletions
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: mux.c,v 1.19 2010/06/17 07:07:30 djm Exp $ */ | 1 | /* $OpenBSD: mux.c,v 1.20 2010/06/25 07:14:46 djm Exp $ */ |
2 | /* | 2 | /* |
3 | * Copyright (c) 2002-2008 Damien Miller <djm@openbsd.org> | 3 | * Copyright (c) 2002-2008 Damien Miller <djm@openbsd.org> |
4 | * | 4 | * |
@@ -727,9 +727,7 @@ process_mux_open_fwd(u_int rid, Channel *c, Buffer *m, Buffer *r) | |||
727 | } | 727 | } |
728 | 728 | ||
729 | if (ftype == MUX_FWD_LOCAL || ftype == MUX_FWD_DYNAMIC) { | 729 | if (ftype == MUX_FWD_LOCAL || ftype == MUX_FWD_DYNAMIC) { |
730 | if (options.num_local_forwards + 1 >= | 730 | if (channel_setup_local_fwd_listener(fwd.listen_host, |
731 | SSH_MAX_FORWARDS_PER_DIRECTION || | ||
732 | channel_setup_local_fwd_listener(fwd.listen_host, | ||
733 | fwd.listen_port, fwd.connect_host, fwd.connect_port, | 731 | fwd.listen_port, fwd.connect_host, fwd.connect_port, |
734 | options.gateway_ports) < 0) { | 732 | options.gateway_ports) < 0) { |
735 | fail: | 733 | fail: |
@@ -744,16 +742,14 @@ process_mux_open_fwd(u_int rid, Channel *c, Buffer *m, Buffer *r) | |||
744 | } else { | 742 | } else { |
745 | struct mux_channel_confirm_ctx *fctx; | 743 | struct mux_channel_confirm_ctx *fctx; |
746 | 744 | ||
747 | if (options.num_remote_forwards + 1 >= | 745 | if (channel_request_remote_forwarding(fwd.listen_host, |
748 | SSH_MAX_FORWARDS_PER_DIRECTION || | ||
749 | channel_request_remote_forwarding(fwd.listen_host, | ||
750 | fwd.listen_port, fwd.connect_host, fwd.connect_port) < 0) | 746 | fwd.listen_port, fwd.connect_host, fwd.connect_port) < 0) |
751 | goto fail; | 747 | goto fail; |
752 | add_remote_forward(&options, &fwd); | 748 | add_remote_forward(&options, &fwd); |
753 | fctx = xcalloc(1, sizeof(*fctx)); | 749 | fctx = xcalloc(1, sizeof(*fctx)); |
754 | fctx->cid = c->self; | 750 | fctx->cid = c->self; |
755 | fctx->rid = rid; | 751 | fctx->rid = rid; |
756 | fctx->fid = options.num_remote_forwards-1; | 752 | fctx->fid = options.num_remote_forwards - 1; |
757 | client_register_global_confirm(mux_confirm_remote_forward, | 753 | client_register_global_confirm(mux_confirm_remote_forward, |
758 | fctx); | 754 | fctx); |
759 | freefwd = 0; | 755 | freefwd = 0; |