IETF-SSH archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: Invalid channel numbers



> Is there any concept of an invalid channel number for SSH channels,
> akin to the Posix convention that -1 is always an invalid file
> descriptor/error status value?  It'd be useful to have a never-valid
> value to use akin to the way -1 is used (or at least returned) for
> open/creat to indicate a non-file descriptor.

For channel numbers assigned by your implementation, you can simply
make sure you never assign your favourite flag value (-1 or whatever),
and you're fine.

For channel numbers assigned by the peer, I don't think there are any
reserved values; you need to keep the valid bit somewhere else.  I
suppose you could build an implementation that croaks if the peer ever
uses channel 0xffffffff, but that strikes me as rather broken.

Since it's probably an ignorable possibility that the peer will ever
use all 4294967296 distinct channel numbers, you could perhaps track
what numbers have been used and use any number that hasn't as your
flag, switching if the peer uses your flag value.  It'd mean some
interesting tapdancing and would likely be more complex than just
keeping a separate valid bit, but it could be done.

/~\ The ASCII				der Mouse
\ / Ribbon Campaign
 X  Against HTML	       mouse%rodents.montreal.qc.ca@localhost
/ \ Email!	     7D C8 61 52 5D E7 2D 39  4E F1 31 3E E8 B3 27 4B



Home | Main Index | Thread Index | Old Index