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)
downloadopenssh-git-9f53229c2ac97dbc6f5a03657de08a1150a9ac7e.tar.gz
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 f04c43af..d1cf5dc6 100644
--- a/channels.h
+++ b/channels.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: channels.h,v 1.128 2017/09/12 06:32:07 djm Exp $ */
+/* $OpenBSD: channels.h,v 1.129 2017/09/12 06:35:32 djm Exp $ */
/*
* Author: Tatu Ylonen <ylo@cs.hut.fi>
@@ -97,8 +97,9 @@ typedef int mux_callback_fn(struct ssh *, struct Channel *);
struct Channel {
int type; /* channel type/state */
int self; /* my own channel identifier */
- int remote_id; /* channel identifier for remote peer */
- /* XXX should be uint32_t */
+ uint32_t remote_id; /* channel identifier for remote peer */
+ int have_remote_id; /* non-zero if remote_id is valid */
+
u_int istate; /* input from channel (state of receive half) */
u_int ostate; /* output to channel (state of transmit half) */
int flags; /* close sent/rcvd */
@@ -222,7 +223,7 @@ void channel_init_channels(struct ssh *ssh);
/* channel management */
Channel *channel_by_id(struct ssh *, int);
-Channel *channel_by_remote_id(struct ssh *, int);
+Channel *channel_by_remote_id(struct ssh *, u_int);
Channel *channel_lookup(struct ssh *, int);
Channel *channel_new(struct ssh *, char *, int, int, int, int,
u_int, u_int, int, char *, int);