summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorEnno Gröper <groepeen@cms.hu-berlin.de>2014-02-11 13:04:11 +0100
committerJeff Forcier <jeff@bitprophet.org>2014-12-17 13:58:10 -0800
commitf92c519e91824e39601f69f7115b604f9318dd7a (patch)
treec902d674e1f3896f7ea8aec780162e243aa33f5c
parent8f2d8c044463ef0620f91d4eafa118e4d6960b1c (diff)
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: <class 'paramiko.SSHException'>: 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. Conflicts: paramiko/transport.py
-rw-r--r--paramiko/transport.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/paramiko/transport.py b/paramiko/transport.py
index ab30f058..cbbdb79f 100644
--- a/paramiko/transport.py
+++ b/paramiko/transport.py
@@ -232,7 +232,7 @@ class Transport (threading.Thread):
self._channels = ChannelMap()
self.channel_events = {} # (id -> Event)
self.channels_seen = {} # (id -> True)
- self._channel_counter = 1
+ self._channel_counter = 0
self.window_size = 65536
self.max_packet_size = 34816
self._forward_agent_handler = None