[openwrt/openwrt] dropbear: add option to set receive window size

LEDE Commits lede-commits at lists.infradead.org
Sat Feb 17 18:40:30 PST 2018


stintel pushed a commit to openwrt/openwrt.git, branch master:
https://git.lede-project.org/1c308bbbf598e09e463f67686ff4b7dafcb98ae6

commit 1c308bbbf598e09e463f67686ff4b7dafcb98ae6
Author: Stijn Tintel <stijn at linux-ipv6.be>
AuthorDate: Sun Feb 18 01:15:58 2018 +0100

    dropbear: add option to set receive window size
    
    The default receive window size in dropbear is hardcoded to 24576 byte
    to limit memory usage. This value was chosen for 100Mbps networks, and
    limits the throughput of scp on faster networks. It also severely limits
    scp throughput on high-latency links.
    
    Add an option to set the receive window size so that people can improve
    performance without having to recompile dropbear.
    
    Setting the window size to the highest value supported by dropbear
    improves throughput from my build machine to an APU2 on the same LAN
    from 7MB/s to 7.9MB/s, and to an APU2 over a link with ~65ms latency
    from 320KB/s to 7.5MB/s.
    
    Signed-off-by: Stijn Tintel <stijn at linux-ipv6.be>
---
 package/network/services/dropbear/files/dropbear.init | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/package/network/services/dropbear/files/dropbear.init b/package/network/services/dropbear/files/dropbear.init
index 3d8cb2c..2225113 100755
--- a/package/network/services/dropbear/files/dropbear.init
+++ b/package/network/services/dropbear/files/dropbear.init
@@ -42,6 +42,7 @@ validate_section_dropbear()
 		'SSHKeepAlive:uinteger:300' \
 		'IdleTimeout:uinteger:0' \
 		'MaxAuthTries:uinteger:3' \
+		'RecvWindowSize:uinteger:0' \
 		'mdns:bool:1'
 }
 
@@ -50,7 +51,7 @@ dropbear_instance()
 	local PasswordAuth enable Interface GatewayPorts \
 		RootPasswordAuth RootLogin rsakeyfile \
 		BannerFile Port SSHKeepAlive IdleTimeout \
-		MaxAuthTries mdns ipaddrs
+		MaxAuthTries RecvWindowSize mdns ipaddrs
 
 	validate_section_dropbear "${1}" || {
 		echo "validation failed"
@@ -80,6 +81,8 @@ dropbear_instance()
 	[ "${IdleTimeout}" -ne 0 ] && procd_append_param command -I "${IdleTimeout}"
 	[ "${SSHKeepAlive}" -ne 0 ] && procd_append_param command -K "${SSHKeepAlive}"
 	[ "${MaxAuthTries}" -ne 0 ] && procd_append_param command -T "${MaxAuthTries}"
+	[ "${RecvWindowSize}" -gt 0 -a "${RecvWindowSize}" -le 1048576 ] && \
+		procd_append_param command -W "${RecvWindowSize}"
 	[ "${mdns}" -ne 0 ] && procd_add_mdns "ssh" "tcp" "$Port" "daemon=dropbear"
 	procd_set_param respawn
 	procd_close_instance



More information about the lede-commits mailing list