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

Bug#495917: openssh-client: unable to connect to Netscreen Devices with version 1:5.1p1-2



On Wed, Aug 27, 2008 at 02:51:08PM +0100, Dave Holland wrote:
> A colleague tells me:
> 
> | There appears to be a bug in XOS switches that mean that if you try and
> | ssh to them from a machine running openssh 4.7 or higher (this is the
> | default on lenny) then you will fail to connect with a message "channel
> | 0: open failed: resource shortage: Channel open failed".
> | 
> | This is down to an increase in the window size available in the ssh
> | client. I've made a patched version of the openssh 5.1 binary which
> | reduces the window size back to the pre  openssh 4.7 size (4k rather
> | than 64k).
> | 
> | The work around is to change the advertised window size back to 4 from
> | 64k in channels.h
> | 
> | 151c151
> | < #define CHAN_SES_WINDOW_DEFAULT	(64*CHAN_SES_PACKET_DEFAULT)
> | ---
> | > #define CHAN_SES_WINDOW_DEFAULT	(4*CHAN_SES_PACKET_DEFAULT)
> | 153c153
> | < #define CHAN_TCP_WINDOW_DEFAULT	(64*CHAN_TCP_PACKET_DEFAULT)
> | ---
> | > #define CHAN_TCP_WINDOW_DEFAULT	(4*CHAN_TCP_PACKET_DEFAULT)
> 
> I've asked him to report the bug to Extreme too.

Does the rather ugly patch attached to this mail help?

-- 
Colin Watson                                       [cjwatson@debian.org]
Index: channels.h
===================================================================
RCS file: /home/cjwatson/cvs/openssh/openssh/channels.h,v
retrieving revision 1.1.1.10
diff -p -u -r1.1.1.10 channels.h
--- channels.h	22 Jul 2008 14:59:34 -0000	1.1.1.10
+++ channels.h	27 Aug 2008 14:58:46 -0000
@@ -148,9 +148,9 @@ struct Channel {
 
 /* default window/packet sizes for tcp/x11-fwd-channel */
 #define CHAN_SES_PACKET_DEFAULT	(32*1024)
-#define CHAN_SES_WINDOW_DEFAULT	(64*CHAN_SES_PACKET_DEFAULT)
+#define CHAN_SES_WINDOW_DEFAULT	((datafellows & SSH_BUG_WINDOWSIZE) ? (4*CHAN_SES_PACKET_DEFAULT) : (64*CHAN_SES_PACKET_DEFAULT))
 #define CHAN_TCP_PACKET_DEFAULT	(32*1024)
-#define CHAN_TCP_WINDOW_DEFAULT	(64*CHAN_TCP_PACKET_DEFAULT)
+#define CHAN_TCP_WINDOW_DEFAULT	((datafellows & SSH_BUG_WINDOWSIZE) ? (4*CHAN_TCP_PACKET_DEFAULT) : (64*CHAN_TCP_PACKET_DEFAULT))
 #define CHAN_X11_PACKET_DEFAULT	(16*1024)
 #define CHAN_X11_WINDOW_DEFAULT	(4*CHAN_X11_PACKET_DEFAULT)
 
Index: compat.c
===================================================================
RCS file: /home/cjwatson/cvs/openssh/openssh/compat.c,v
retrieving revision 1.1.1.7
diff -p -u -r1.1.1.7 compat.c
--- compat.c	12 Jun 2007 11:03:10 -0000	1.1.1.7
+++ compat.c	27 Aug 2008 14:58:46 -0000
@@ -160,6 +160,7 @@ compat_datafellows(const char *version)
 					SSH_BUG_SCANNER },
 		{ "Probe-*",
 					SSH_BUG_PROBE },
+		{ "NetScreen",		SSH_BUG_WINDOWSIZE },
 		{ NULL,			0 }
 	};
 
Index: compat.h
===================================================================
RCS file: /home/cjwatson/cvs/openssh/openssh/compat.h,v
retrieving revision 1.1.1.8
diff -p -u -r1.1.1.8 compat.h
--- compat.h	12 Jun 2007 11:03:10 -0000	1.1.1.8
+++ compat.h	27 Aug 2008 14:58:46 -0000
@@ -57,6 +57,7 @@
 #define SSH_BUG_FIRSTKEX	0x00800000
 #define SSH_OLD_FORWARD_ADDR	0x01000000
 #define SSH_BUG_RFWD_ADDR	0x02000000
+#define SSH_BUG_WINDOWSIZE	0x04000000
 
 void     enable_compat13(void);
 void     enable_compat20(void);
Index: mux.c
===================================================================
RCS file: /home/cjwatson/cvs/openssh/openssh/mux.c,v
retrieving revision 1.2
diff -p -u -r1.2 mux.c
--- mux.c	22 Jul 2008 19:45:18 -0000	1.2
+++ mux.c	27 Aug 2008 14:58:46 -0000
@@ -71,6 +71,7 @@
 #include "misc.h"
 #include "match.h"
 #include "buffer.h"
+#include "compat.h"
 #include "channels.h"
 #include "msg.h"
 #include "packet.h"

Reply to: