summaryrefslogtreecommitdiff
path: root/channels.h
diff options
context:
space:
mode:
authordjm@openbsd.org <djm@openbsd.org>2017-09-12 06:35:31 +0000
committerDamien Miller <djm@mindrot.org>2017-09-12 17:37:03 +1000
commit9f53229c2ac97dbc6f5a03657de08a1150a9ac7e (patch)
tree4f74dc06676dc6dce2b2bc3aa6beb248a1d8def6 /channels.h
parentdbee4119b502e3f8b6cd3282c69c537fd01d8e16 (diff)
upstream commit
Make remote channel ID a u_int Previously we tracked the remote channel IDs in an int, but this is strictly incorrect: the wire protocol uses uint32 and there is nothing in-principle stopping a SSH implementation from sending, say, 0xffff0000. In practice everyone numbers their channels sequentially, so this has never been a problem. ok markus@ Upstream-ID: b9f4cd3dc53155b4a5c995c0adba7da760d03e73
Diffstat (limited to 'channels.h')
-rw-r--r--channels.h9
1 files changed, 5 insertions, 4 deletions
diff --git a/channels.h b/channels.h
index f04c43afa..d1cf5dc6a 100644
--- a/channels.h
+++ b/channels.h
@@ -1,4 +1,4 @@
1/* $OpenBSD: channels.h,v 1.128 2017/09/12 06:32:07 djm Exp $ */ 1/* $OpenBSD: channels.h,v 1.129 2017/09/12 06:35:32 djm Exp $ */
2 2
3/* 3/*
4 * Author: Tatu Ylonen <ylo@cs.hut.fi> 4 * Author: Tatu Ylonen <ylo@cs.hut.fi>
@@ -97,8 +97,9 @@ typedef int mux_callback_fn(struct ssh *, struct Channel *);
97struct Channel { 97struct Channel {
98 int type; /* channel type/state */ 98 int type; /* channel type/state */
99 int self; /* my own channel identifier */ 99 int self; /* my own channel identifier */
100 int remote_id; /* channel identifier for remote peer */ 100 uint32_t remote_id; /* channel identifier for remote peer */
101 /* XXX should be uint32_t */ 101 int have_remote_id; /* non-zero if remote_id is valid */
102
102 u_int istate; /* input from channel (state of receive half) */ 103 u_int istate; /* input from channel (state of receive half) */
103 u_int ostate; /* output to channel (state of transmit half) */ 104 u_int ostate; /* output to channel (state of transmit half) */
104 int flags; /* close sent/rcvd */ 105 int flags; /* close sent/rcvd */
@@ -222,7 +223,7 @@ void channel_init_channels(struct ssh *ssh);
222/* channel management */ 223/* channel management */
223 224
224Channel *channel_by_id(struct ssh *, int); 225Channel *channel_by_id(struct ssh *, int);
225Channel *channel_by_remote_id(struct ssh *, int); 226Channel *channel_by_remote_id(struct ssh *, u_int);
226Channel *channel_lookup(struct ssh *, int); 227Channel *channel_lookup(struct ssh *, int);
227Channel *channel_new(struct ssh *, char *, int, int, int, int, 228Channel *channel_new(struct ssh *, char *, int, int, int, int,
228 u_int, u_int, int, char *, int); 229 u_int, u_int, int, char *, int);