Bugzilla – Attachment 1013 Details for
Bug 1014
SCP slow bandwidth with Solaris8 on n240
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Increase SSH2 channel window, based on HPN-SSH patch
openssh-hpn-channel.patch (text/plain), 5.78 KB, created by
Darren Tucker
on 2005-10-26 18:20:10 AEST
(
hide
)
Description:
Increase SSH2 channel window, based on HPN-SSH patch
Filename:
MIME Type:
Creator:
Darren Tucker
Created:
2005-10-26 18:20:10 AEST
Size:
5.78 KB
patch
obsolete
>Index: channels.c >=================================================================== >RCS file: /usr/local/src/security/openssh/cvs/openssh_cvs/channels.c,v >retrieving revision 1.202 >diff -u -p -r1.202 channels.c >--- channels.c 3 Oct 2005 08:03:05 -0000 1.202 >+++ channels.c 16 Oct 2005 11:00:23 -0000 >@@ -139,6 +139,19 @@ static int IPv4or6 = AF_UNSPEC; > /* helper */ > static void port_open_helper(Channel *c, char *rtype); > >+static u_int32_t >+tcp_window_size(void) >+{ >+ u_int32_t tcpwinsz = 0; >+ socklen_t optsz = sizeof(tcpwinsz); >+ >+ if (getsockopt(packet_get_connection_in(), SOL_SOCKET, SO_RCVBUF, >+ &tcpwinsz, &optsz) == 0) >+ return tcpwinsz; >+ else >+ return 0; >+} >+ > /* -- channel core */ > > Channel * >@@ -262,6 +275,7 @@ channel_new(char *ctype, int type, int r > c->local_window_max = window; > c->local_consumed = 0; > c->local_maxpacket = maxpack; >+ c->dynamic_window = 0; > c->remote_id = -1; > c->remote_name = xstrdup(remote_name); > c->remote_window = 0; >@@ -1533,18 +1547,32 @@ channel_handle_ctl(Channel *c, fd_set * > static int > channel_check_window(Channel *c) > { >+ u_int32_t winsz, addition = 0, adjust = 0; >+ > if (c->type == SSH_CHANNEL_OPEN && > !(c->flags & (CHAN_CLOSE_SENT|CHAN_CLOSE_RCVD)) && > c->local_window < c->local_window_max/2 && > c->local_consumed > 0) { >+ /* >+ * If the TCP window is larger than the channel window then >+ * make the adjust large enough for the sender to fill it. >+ */ >+ if (c->dynamic_window) { >+ winsz = tcp_window_size(); >+ if (winsz > c->local_window_max) { >+ addition = winsz - c->local_window_max; >+ c->local_window_max += addition; >+ } >+ } >+ adjust = c->local_consumed + addition; >+ > packet_start(SSH2_MSG_CHANNEL_WINDOW_ADJUST); > packet_put_int(c->remote_id); >- packet_put_int(c->local_consumed); >+ packet_put_int(adjust); > packet_send(); > debug2("channel %d: window %d sent adjust %d", >- c->self, c->local_window, >- c->local_consumed); >- c->local_window += c->local_consumed; >+ c->self, c->local_window, adjust); >+ c->local_window += adjust; > c->local_consumed = 0; > } > return 1; >Index: channels.h >=================================================================== >RCS file: /usr/local/src/security/openssh/cvs/openssh_cvs/channels.h,v >retrieving revision 1.72 >diff -u -p -r1.72 channels.h >--- channels.h 17 Jul 2005 07:19:25 -0000 1.72 >+++ channels.h 16 Oct 2005 11:01:30 -0000 >@@ -99,6 +99,7 @@ struct Channel { > u_int local_window_max; > u_int local_consumed; > u_int local_maxpacket; >+ int dynamic_window; > int extended_usage; > int single_connection; > >Index: compat.c >=================================================================== >RCS file: /usr/local/src/security/openssh/cvs/openssh_cvs/compat.c,v >retrieving revision 1.71 >diff -u -p -r1.71 compat.c >--- compat.c 1 Mar 2005 10:24:33 -0000 1.71 >+++ compat.c 16 Oct 2005 06:08:16 -0000 >@@ -62,30 +62,39 @@ compat_datafellows(const char *version) > "OpenSSH_2.1*," > "OpenSSH_2.2*", SSH_OLD_SESSIONID|SSH_BUG_BANNER| > SSH_OLD_DHGEX|SSH_BUG_NOREKEY| >- SSH_BUG_EXTEOF|SSH_OLD_FORWARD_ADDR}, >+ SSH_BUG_EXTEOF|SSH_OLD_FORWARD_ADDR| >+ SSH_BUG_LARGEWINDOW}, > { "OpenSSH_2.3.0*", SSH_BUG_BANNER|SSH_BUG_BIGENDIANAES| > SSH_OLD_DHGEX|SSH_BUG_NOREKEY| >- SSH_BUG_EXTEOF|SSH_OLD_FORWARD_ADDR}, >+ SSH_BUG_EXTEOF|SSH_OLD_FORWARD_ADDR| >+ SSH_BUG_LARGEWINDOW}, > { "OpenSSH_2.3.*", SSH_BUG_BIGENDIANAES|SSH_OLD_DHGEX| > SSH_BUG_NOREKEY|SSH_BUG_EXTEOF| >- SSH_OLD_FORWARD_ADDR}, >+ SSH_OLD_FORWARD_ADDR| >+ SSH_BUG_LARGEWINDOW}, > { "OpenSSH_2.5.0p1*," > "OpenSSH_2.5.1p1*", > SSH_BUG_BIGENDIANAES|SSH_OLD_DHGEX| > SSH_BUG_NOREKEY|SSH_BUG_EXTEOF| >- SSH_OLD_FORWARD_ADDR}, >+ SSH_OLD_FORWARD_ADDR| >+ SSH_BUG_LARGEWINDOW}, > { "OpenSSH_2.5.0*," > "OpenSSH_2.5.1*," > "OpenSSH_2.5.2*", SSH_OLD_DHGEX|SSH_BUG_NOREKEY| > SSH_BUG_EXTEOF|SSH_OLD_FORWARD_ADDR}, > { "OpenSSH_2.5.3*", SSH_BUG_NOREKEY|SSH_BUG_EXTEOF| >- SSH_OLD_FORWARD_ADDR}, >+ SSH_OLD_FORWARD_ADDR| >+ SSH_BUG_LARGEWINDOW}, > { "OpenSSH_2.*," > "OpenSSH_3.0*," >- "OpenSSH_3.1*", SSH_BUG_EXTEOF|SSH_OLD_FORWARD_ADDR}, >- { "OpenSSH_3.*", SSH_OLD_FORWARD_ADDR }, >- { "Sun_SSH_1.0*", SSH_BUG_NOREKEY|SSH_BUG_EXTEOF}, >+ "OpenSSH_3.1*", SSH_BUG_EXTEOF|SSH_OLD_FORWARD_ADDR| >+ SSH_BUG_LARGEWINDOW}, >+ { "OpenSSH_3.*", SSH_OLD_FORWARD_ADDR| >+ SSH_BUG_LARGEWINDOW}, >+ { "OpenSSH_4.0.*", SSH_BUG_LARGEWINDOW}, > { "OpenSSH*", 0 }, >+ { "Sun_SSH_1.0*", SSH_BUG_NOREKEY|SSH_BUG_EXTEOF| >+ SSH_BUG_LARGEWINDOW}, > { "*MindTerm*", 0 }, > { "2.1.0*", SSH_BUG_SIGBLOB|SSH_BUG_HMAC| > SSH_OLD_SESSIONID|SSH_BUG_DEBUG| >Index: compat.h >=================================================================== >RCS file: /usr/local/src/security/openssh/cvs/openssh_cvs/compat.h,v >retrieving revision 1.37 >diff -u -p -r1.37 compat.h >--- compat.h 1 Mar 2005 10:24:33 -0000 1.37 >+++ compat.h 16 Oct 2005 04:32:22 -0000 >@@ -56,6 +56,7 @@ > #define SSH_BUG_PROBE 0x00400000 > #define SSH_BUG_FIRSTKEX 0x00800000 > #define SSH_OLD_FORWARD_ADDR 0x01000000 >+#define SSH_BUG_LARGEWINDOW 0x02000000 > > void enable_compat13(void); > void enable_compat20(void); >Index: serverloop.c >=================================================================== >RCS file: /usr/local/src/security/openssh/cvs/openssh_cvs/serverloop.c,v >retrieving revision 1.119 >diff -u -p -r1.119 serverloop.c >--- serverloop.c 17 Jul 2005 07:26:44 -0000 1.119 >+++ serverloop.c 16 Oct 2005 02:40:07 -0000 >@@ -895,6 +895,8 @@ server_request_session(void) > c = channel_new("session", SSH_CHANNEL_LARVAL, > -1, -1, -1, /*window size*/0, CHAN_SES_PACKET_DEFAULT, > 0, "server-session", 1); >+ if (!(datafellows & SSH_BUG_LARGEWINDOW)) >+ c->dynamic_window = 1; > if (session_open(the_authctxt, c->self) != 1) { > debug("session open failed, free channel %d", c->self); > channel_free(c);
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 1014
:
874
|
884
| 1013