Skip to content

Instantly share code, notes, and snippets.

@danp
Created November 11, 2008 19:25
Show Gist options
  • Save danp/23942 to your computer and use it in GitHub Desktop.
Save danp/23942 to your computer and use it in GitHub Desktop.
diff -urN openssh-5.1p1/channels.h openssh-5.1p1.danp/channels.h
--- openssh-5.1p1/channels.h 2008-06-15 18:59:23.000000000 -0300
+++ openssh-5.1p1.danp/channels.h 2008-11-01 22:43:33.000000000 -0300
@@ -148,9 +148,9 @@
/* 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)
diff -urN openssh-5.1p1/compat.c openssh-5.1p1.danp/compat.c
--- openssh-5.1p1/compat.c 2007-01-05 01:26:46.000000000 -0400
+++ openssh-5.1p1.danp/compat.c 2008-11-01 22:42:34.000000000 -0300
@@ -160,6 +160,7 @@
SSH_BUG_SCANNER },
{ "Probe-*",
SSH_BUG_PROBE },
+ { "*4.1.2*", SSH_BUG_WINDOWSIZE },
{ NULL, 0 }
};
diff -urN openssh-5.1p1/compat.h openssh-5.1p1.danp/compat.h
--- openssh-5.1p1/compat.h 2007-01-05 01:26:46.000000000 -0400
+++ openssh-5.1p1.danp/compat.h 2008-11-01 22:43:55.000000000 -0300
@@ -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);
diff -urN openssh-5.1p1/mux.c openssh-5.1p1.danp/mux.c
--- openssh-5.1p1/mux.c 2008-06-13 20:01:54.000000000 -0300
+++ openssh-5.1p1.danp/mux.c 2008-11-01 22:44:12.000000000 -0300
@@ -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"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment