Re: [LEDE-DEV] [PATCH] dropbear: Fix append_port in IPv6 case (v2)

2016-07-28 Thread Laurent GUERBY
On Thu, 2016-07-28 at 07:07 +0200, John Crispin wrote:
> 
> On 09/07/2016 23:55, Laurent GUERBY wrote:
> > 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.
> > 
> > Fix indentation and missing then of previous patch.
> > 
> > Signed-off-by: Laurent GUERBY 
> > ---
> >  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..c4d6c78 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'
> >  }
> 
> Hi,
> 
> maybe ipaddrs6 and Port6 might be better ? depending the choice of v4 vs
> v6 on the name of the port parameter seems odd, specially as it is not
> named in a consistent manner.
> 
>   John

Hi,

I chose IPPort because the option is not specific to v6 : it just
tells the script system to pass an unmodified "-p" argument to dropbear.

The current Port option if not given an IP will listen
on both v4 and v6 (that's what make it currently "work"
in v6). Making Port work only in IPv4 is quite a bit more
work, you have to get all the IPv4 and pass them as "-p IPv4:port"
(and it will change the current behaviour).

But may be I'm misunderstanding your proposal?

Sincerely,

Laurent

> 
> >  
> >  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}" ]; then
> > +   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"
> > 



___
Lede-dev mailing list
Lede-dev@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/lede-dev


Re: [LEDE-DEV] [PATCH] dropbear: Fix append_port in IPv6 case (v2)

2016-07-27 Thread John Crispin


On 09/07/2016 23:55, Laurent GUERBY wrote:
> 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.
> 
> Fix indentation and missing then of previous patch.
> 
> Signed-off-by: Laurent GUERBY 
> ---
>  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..c4d6c78 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'
>  }

Hi,

maybe ipaddrs6 and Port6 might be better ? depending the choice of v4 vs
v6 on the name of the port parameter seems odd, specially as it is not
named in a consistent manner.

John


>  
>  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}" ]; then
> + 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"
> 

___
Lede-dev mailing list
Lede-dev@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/lede-dev


[LEDE-DEV] [PATCH] dropbear: Fix append_port in IPv6 case (v2)

2016-07-09 Thread Laurent GUERBY
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.

Fix indentation and missing then of previous patch.

Signed-off-by: Laurent GUERBY 
---
 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..c4d6c78 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}" ]; then
+   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


___
Lede-dev mailing list
Lede-dev@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/lede-dev