paramiko/paramiko — pull request #266 by egroeper (2014-02-11 12:08:21+00:00)
Title: Fix Connection to Enterasys B2 Switch

Connecting to an Enterasys B2 Switch (using demo_simple.py) for an
interactive shell doesn't work:

Connected. Getting Shell...
DEBUG:paramiko.transport:[chan 1] Max packet in: 34816 bytes
DEBUG:paramiko.transport:[chan 1] Max packet out: 16384
bytes
INFO:paramiko.transport:Secsh channel 1 opened.
ERROR:paramiko.transport:Channel request for unknown
channel 0
*** Caught exception: : Channel closed.

The channels gets opened with index 1 on client
(paramiko) side and index 0 on server (switch)
side.
Probably the switch doesn't support this and
replies to the pty request with a wrong channel
id. Because of that paramiko closes the
connection.

This can be solved (or worked around) easily by
initialising _channel_counter with 0.
This is what other clients, like openssh do.

I don't see a problem with initialising this
counter with 0.
Would this be acceptable?