summaryrefslogtreecommitdiff
path: root/channels.c
diff options
context:
space:
mode:
authormarkus@openbsd.org <markus@openbsd.org>2017-05-30 14:23:52 +0000
committerDamien Miller <djm@mindrot.org>2017-05-31 10:50:05 +1000
commit2ae666a8fc20b3b871b2f1b90ad65cc027336ccd (patch)
treef13f1c949ae60c16160acebbfb680c3dc7b13fe5 /channels.c
parent94583beb24a6c5fd19cedb9104ab2d2d5cd052b6 (diff)
upstream commit
protocol handlers all get struct ssh passed; ok djm@ Upstream-ID: 0ca9ea2a5d01a6d2ded94c5024456a930c5bfb5d
Diffstat (limited to 'channels.c')
-rw-r--r--channels.c37
1 files changed, 18 insertions, 19 deletions
diff --git a/channels.c b/channels.c
index e7de370d..d118d8ff 100644
--- a/channels.c
+++ b/channels.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: channels.c,v 1.362 2017/05/30 08:49:58 markus Exp $ */
+/* $OpenBSD: channels.c,v 1.363 2017/05/30 14:23:52 markus Exp $ */
/*
* Author: Tatu Ylonen <ylo@cs.hut.fi>
* Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
@@ -2394,9 +2394,8 @@ channel_proxy_downstream(Channel *downstream)
* replaces local (proxy) channel ID with downstream channel ID.
*/
int
-channel_proxy_upstream(Channel *c, int type, u_int32_t seq, void *ctxt)
+channel_proxy_upstream(Channel *c, int type, u_int32_t seq, struct ssh *ssh)
{
- struct ssh *ssh = active_state;
struct sshbuf *b = NULL;
Channel *downstream;
const u_char *cp = NULL;
@@ -2476,7 +2475,7 @@ channel_proxy_upstream(Channel *c, int type, u_int32_t seq, void *ctxt)
/* ARGSUSED */
int
-channel_input_data(int type, u_int32_t seq, void *ctxt)
+channel_input_data(int type, u_int32_t seq, struct ssh *ssh)
{
int id;
const u_char *data;
@@ -2488,7 +2487,7 @@ channel_input_data(int type, u_int32_t seq, void *ctxt)
c = channel_lookup(id);
if (c == NULL)
packet_disconnect("Received data for nonexistent channel %d.", id);
- if (channel_proxy_upstream(c, type, seq, ctxt))
+ if (channel_proxy_upstream(c, type, seq, ssh))
return 0;
/* Ignore any data for non-open channels (might happen on close) */
@@ -2536,7 +2535,7 @@ channel_input_data(int type, u_int32_t seq, void *ctxt)
/* ARGSUSED */
int
-channel_input_extended_data(int type, u_int32_t seq, void *ctxt)
+channel_input_extended_data(int type, u_int32_t seq, struct ssh *ssh)
{
int id;
char *data;
@@ -2549,7 +2548,7 @@ channel_input_extended_data(int type, u_int32_t seq, void *ctxt)
if (c == NULL)
packet_disconnect("Received extended_data for bad channel %d.", id);
- if (channel_proxy_upstream(c, type, seq, ctxt))
+ if (channel_proxy_upstream(c, type, seq, ssh))
return 0;
if (c->type != SSH_CHANNEL_OPEN) {
logit("channel %d: ext data for non open", id);
@@ -2586,7 +2585,7 @@ channel_input_extended_data(int type, u_int32_t seq, void *ctxt)
/* ARGSUSED */
int
-channel_input_ieof(int type, u_int32_t seq, void *ctxt)
+channel_input_ieof(int type, u_int32_t seq, struct ssh *ssh)
{
int id;
Channel *c;
@@ -2596,7 +2595,7 @@ channel_input_ieof(int type, u_int32_t seq, void *ctxt)
c = channel_lookup(id);
if (c == NULL)
packet_disconnect("Received ieof for nonexistent channel %d.", id);
- if (channel_proxy_upstream(c, type, seq, ctxt))
+ if (channel_proxy_upstream(c, type, seq, ssh))
return 0;
chan_rcvd_ieof(c);
@@ -2612,14 +2611,14 @@ channel_input_ieof(int type, u_int32_t seq, void *ctxt)
/* ARGSUSED */
int
-channel_input_oclose(int type, u_int32_t seq, void *ctxt)
+channel_input_oclose(int type, u_int32_t seq, struct ssh *ssh)
{
int id = packet_get_int();
Channel *c = channel_lookup(id);
if (c == NULL)
packet_disconnect("Received oclose for nonexistent channel %d.", id);
- if (channel_proxy_upstream(c, type, seq, ctxt))
+ if (channel_proxy_upstream(c, type, seq, ssh))
return 0;
packet_check_eom();
chan_rcvd_oclose(c);
@@ -2628,7 +2627,7 @@ channel_input_oclose(int type, u_int32_t seq, void *ctxt)
/* ARGSUSED */
int
-channel_input_open_confirmation(int type, u_int32_t seq, void *ctxt)
+channel_input_open_confirmation(int type, u_int32_t seq, struct ssh *ssh)
{
int id, remote_id;
Channel *c;
@@ -2639,7 +2638,7 @@ channel_input_open_confirmation(int type, u_int32_t seq, void *ctxt)
if (c==NULL)
packet_disconnect("Received open confirmation for "
"unknown channel %d.", id);
- if (channel_proxy_upstream(c, type, seq, ctxt))
+ if (channel_proxy_upstream(c, type, seq, ssh))
return 0;
if (c->type != SSH_CHANNEL_OPENING)
packet_disconnect("Received open confirmation for "
@@ -2680,7 +2679,7 @@ reason2txt(int reason)
/* ARGSUSED */
int
-channel_input_open_failure(int type, u_int32_t seq, void *ctxt)
+channel_input_open_failure(int type, u_int32_t seq, struct ssh *ssh)
{
int id, reason;
char *msg = NULL, *lang = NULL;
@@ -2692,7 +2691,7 @@ channel_input_open_failure(int type, u_int32_t seq, void *ctxt)
if (c==NULL)
packet_disconnect("Received open failure for "
"unknown channel %d.", id);
- if (channel_proxy_upstream(c, type, seq, ctxt))
+ if (channel_proxy_upstream(c, type, seq, ssh))
return 0;
if (c->type != SSH_CHANNEL_OPENING)
packet_disconnect("Received open failure for "
@@ -2719,7 +2718,7 @@ channel_input_open_failure(int type, u_int32_t seq, void *ctxt)
/* ARGSUSED */
int
-channel_input_window_adjust(int type, u_int32_t seq, void *ctxt)
+channel_input_window_adjust(int type, u_int32_t seq, struct ssh *ssh)
{
Channel *c;
int id;
@@ -2733,7 +2732,7 @@ channel_input_window_adjust(int type, u_int32_t seq, void *ctxt)
logit("Received window adjust for non-open channel %d.", id);
return 0;
}
- if (channel_proxy_upstream(c, type, seq, ctxt))
+ if (channel_proxy_upstream(c, type, seq, ssh))
return 0;
adjust = packet_get_int();
packet_check_eom();
@@ -2747,7 +2746,7 @@ channel_input_window_adjust(int type, u_int32_t seq, void *ctxt)
/* ARGSUSED */
int
-channel_input_status_confirm(int type, u_int32_t seq, void *ctxt)
+channel_input_status_confirm(int type, u_int32_t seq, struct ssh *ssh)
{
Channel *c;
struct channel_confirm *cc;
@@ -2763,7 +2762,7 @@ channel_input_status_confirm(int type, u_int32_t seq, void *ctxt)
logit("channel_input_status_confirm: %d: unknown", id);
return 0;
}
- if (channel_proxy_upstream(c, type, seq, ctxt))
+ if (channel_proxy_upstream(c, type, seq, ssh))
return 0;
packet_check_eom();
if ((cc = TAILQ_FIRST(&c->status_confirms)) == NULL)