diff options
author | Damien Miller <djm@cvs.openbsd.org> | 2020-01-25 22:49:39 +0000 |
---|---|---|
committer | Damien Miller <djm@cvs.openbsd.org> | 2020-01-25 22:49:39 +0000 |
commit | cddf72afe5b07b73e7a00216cacf87779ac8ec54 (patch) | |
tree | 3568fe9482f0d409eb7fa1e337cab1c3d85dc8b6 | |
parent | f108f8a4c68c9bb5e31c2763c9206ba1e2fe5585 (diff) |
add a comment describing the ranges of channel IDs that we use;
requested by markus@
-rw-r--r-- | usr.bin/ssh/channels.h | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/usr.bin/ssh/channels.h b/usr.bin/ssh/channels.h index bdf4d1d575e..2cbdbf2b674 100644 --- a/usr.bin/ssh/channels.h +++ b/usr.bin/ssh/channels.h @@ -1,4 +1,4 @@ -/* $OpenBSD: channels.h,v 1.132 2018/10/04 00:10:11 djm Exp $ */ +/* $OpenBSD: channels.h,v 1.133 2020/01/25 22:49:38 djm Exp $ */ /* * Author: Tatu Ylonen <ylo@cs.hut.fi> @@ -105,8 +105,16 @@ struct channel_connect { /* Callbacks for mux channels back into client-specific code */ typedef int mux_callback_fn(struct ssh *, struct Channel *); +/* + * NB. channel IDs on the wire and in c->remote_id are uint32, but local + * channel IDs (e.g. c->self) only ever use the int32 subset of this range, + * because we use local channel ID -1 for housekeeping. Remote channels have + * a dedicated "have_remote_id" flag to indicate their validity. + */ + struct Channel { int type; /* channel type/state */ + int self; /* my own channel identifier */ uint32_t remote_id; /* channel identifier for remote peer */ int have_remote_id; /* non-zero if remote_id is valid */ |