[LEDE-DEV] [PATCH] dropbear: Add IPPort parameter

Laurent GUERBY laurent at guerby.net
Sat Jul 9 11:57:12 PDT 2016


The new IPPort parameter allows to pass unchanged parameters to dropbear,
dropbear uses -p [ip6]:port for IPv6 and this was not supported with
existing scripts.

Signed-off-by: Laurent GUERBY <laurent at guerby.net>
---
 package/network/services/dropbear/files/dropbear.init | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/package/network/services/dropbear/files/dropbear.init b/package/network/services/dropbear/files/dropbear.init
index 5c3345d..867efd8 100755
--- a/package/network/services/dropbear/files/dropbear.init
+++ b/package/network/services/dropbear/files/dropbear.init
@@ -41,7 +41,8 @@ validate_section_dropbear()
 		'Port:list(port):22' \
 		'SSHKeepAlive:uinteger:300' \
 		'IdleTimeout:uinteger:0' \
-		'mdns:uinteger:1'
+		'mdns:uinteger:1' \
+		'IPPort:string'
 }
 
 dropbear_instance()
@@ -75,7 +76,11 @@ dropbear_instance()
 	[ "${RootLogin}" -eq 0 ] && procd_append_param command -w
 	[ -n "${rsakeyfile}" ] && procd_append_param command -r "${rsakeyfile}"
 	[ -n "${BannerFile}" ] && procd_append_param command -b "${BannerFile}"
-	append_ports "${ipaddrs}" "${Port}"
+	if [ -n "${IPPort}" ];
+		procd_append_param command -p "${IPPort}"
+        else
+		append_ports "${ipaddrs}" "${Port}"
+        fi
 	[ "${IdleTimeout}" -ne 0 ] && procd_append_param command -I "${IdleTimeout}"
 	[ "${SSHKeepAlive}" -ne 0 ] && procd_append_param command -K "${SSHKeepAlive}"
 	[ "${mdns}" -ne 0 ] && procd_add_mdns "ssh" "tcp" "$Port" "daemon=dropbear"
-- 
2.1.4




More information about the Lede-dev mailing list