mailarchive of the ptxdist mailing list
 help / color / mirror / Atom feed
* [ptxdist] [PATCH] openvpn: allow use of iproute2
@ 2019-12-06 10:36 Ladislav Michl
  2020-01-06 10:59 ` Michael Olbrich
  0 siblings, 1 reply; 9+ messages in thread
From: Ladislav Michl @ 2019-12-06 10:36 UTC (permalink / raw)
  To: ptxdist

Let OpenVPN use ip command when BUSYBOX_IP is not selected. This
allows OpenVPN to be used in Busybox-less environments.

Signed-off-by: Ladislav Michl <ladis@linux-mips.org>
---
 rules/openvpn.in   | 10 +++++++---
 rules/openvpn.make |  2 +-
 2 files changed, 8 insertions(+), 4 deletions(-)

diff --git a/rules/openvpn.in b/rules/openvpn.in
index 6958e2940..af8cf1dda 100644
--- a/rules/openvpn.in
+++ b/rules/openvpn.in
@@ -11,9 +11,9 @@ menuconfig OPENVPN
 	select BRIDGE_UTILS		if OPENVPN_INSTALL_SAMPLE_SCRIPTS && RUNTIME
 	select IPROUTE2			if !BUSYBOX_IP && RUNTIME
 	select IPROUTE2_IP		if !BUSYBOX_IP && RUNTIME
-	select BUSYBOX_IFCONFIG		if RUNTIME
-	select BUSYBOX_NETSTAT		if RUNTIME
-	select BUSYBOX_ROUTE		if RUNTIME
+	select BUSYBOX_IFCONFIG		if BUSYBOX_IP && RUNTIME
+	select BUSYBOX_NETSTAT		if BUSYBOX_IP && RUNTIME
+	select BUSYBOX_ROUTE		if BUSYBOX_IP && RUNTIME
 	help
 	  virtual private network daemon
 
@@ -35,6 +35,10 @@ menuconfig OPENVPN
 
 if OPENVPN
 
+config OPENVPN_IPROUTE2
+	bool
+	default !BUSYBOX_IP
+
 config OPENVPN_SMALL
 	bool
 	prompt "Enable smaller executable size"
diff --git a/rules/openvpn.make b/rules/openvpn.make
index dc05384df..0c4f99ff2 100644
--- a/rules/openvpn.make
+++ b/rules/openvpn.make
@@ -67,7 +67,7 @@ OPENVPN_CONF_OPT	:= \
 	--enable-port-share \
 	--disable-debug \
 	--$(call ptx/endis, PTXCONF_OPENVPN_SMALL)-small \
-	--disable-iproute2 \
+	--$(call ptx/endis, PTXCONF_OPENVPN_IPROUTE2)-iproute2 \
 	--enable-def-auth \
 	--enable-pf \
 	--disable-plugin-auth-pam \
-- 
2.24.0


_______________________________________________
ptxdist mailing list
ptxdist@pengutronix.de

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [ptxdist] [PATCH] openvpn: allow use of iproute2
  2019-12-06 10:36 [ptxdist] [PATCH] openvpn: allow use of iproute2 Ladislav Michl
@ 2020-01-06 10:59 ` Michael Olbrich
  2020-05-13 10:39   ` Ladislav Michl
  0 siblings, 1 reply; 9+ messages in thread
From: Michael Olbrich @ 2020-01-06 10:59 UTC (permalink / raw)
  To: ptxdist

On Fri, Dec 06, 2019 at 11:36:13AM +0100, Ladislav Michl wrote:
> Let OpenVPN use ip command when BUSYBOX_IP is not selected. This
> allows OpenVPN to be used in Busybox-less environments.

Hmmm, what does the -{en,dis}able-iproute2 option do exactly?
Could we enable it unconditionally or does BUSYBOX_IP not provide all the
necessary features?

Michael

> Signed-off-by: Ladislav Michl <ladis@linux-mips.org>
> ---
>  rules/openvpn.in   | 10 +++++++---
>  rules/openvpn.make |  2 +-
>  2 files changed, 8 insertions(+), 4 deletions(-)
> 
> diff --git a/rules/openvpn.in b/rules/openvpn.in
> index 6958e2940..af8cf1dda 100644
> --- a/rules/openvpn.in
> +++ b/rules/openvpn.in
> @@ -11,9 +11,9 @@ menuconfig OPENVPN
>  	select BRIDGE_UTILS		if OPENVPN_INSTALL_SAMPLE_SCRIPTS && RUNTIME
>  	select IPROUTE2			if !BUSYBOX_IP && RUNTIME
>  	select IPROUTE2_IP		if !BUSYBOX_IP && RUNTIME
> -	select BUSYBOX_IFCONFIG		if RUNTIME
> -	select BUSYBOX_NETSTAT		if RUNTIME
> -	select BUSYBOX_ROUTE		if RUNTIME
> +	select BUSYBOX_IFCONFIG		if BUSYBOX_IP && RUNTIME
> +	select BUSYBOX_NETSTAT		if BUSYBOX_IP && RUNTIME
> +	select BUSYBOX_ROUTE		if BUSYBOX_IP && RUNTIME
>  	help
>  	  virtual private network daemon
>  
> @@ -35,6 +35,10 @@ menuconfig OPENVPN
>  
>  if OPENVPN
>  
> +config OPENVPN_IPROUTE2
> +	bool
> +	default !BUSYBOX_IP
> +
>  config OPENVPN_SMALL
>  	bool
>  	prompt "Enable smaller executable size"
> diff --git a/rules/openvpn.make b/rules/openvpn.make
> index dc05384df..0c4f99ff2 100644
> --- a/rules/openvpn.make
> +++ b/rules/openvpn.make
> @@ -67,7 +67,7 @@ OPENVPN_CONF_OPT	:= \
>  	--enable-port-share \
>  	--disable-debug \
>  	--$(call ptx/endis, PTXCONF_OPENVPN_SMALL)-small \
> -	--disable-iproute2 \
> +	--$(call ptx/endis, PTXCONF_OPENVPN_IPROUTE2)-iproute2 \
>  	--enable-def-auth \
>  	--enable-pf \
>  	--disable-plugin-auth-pam \
> -- 
> 2.24.0
> 
> 
> _______________________________________________
> ptxdist mailing list
> ptxdist@pengutronix.de
> 

-- 
Pengutronix e.K.                           |                             |
Steuerwalder Str. 21                       | http://www.pengutronix.de/  |
31137 Hildesheim, Germany                  | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

_______________________________________________
ptxdist mailing list
ptxdist@pengutronix.de

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [ptxdist] [PATCH] openvpn: allow use of iproute2
  2020-01-06 10:59 ` Michael Olbrich
@ 2020-05-13 10:39   ` Ladislav Michl
  2020-05-26 12:01     ` Ladislav Michl
  2020-05-29  8:02     ` Michael Olbrich
  0 siblings, 2 replies; 9+ messages in thread
From: Ladislav Michl @ 2020-05-13 10:39 UTC (permalink / raw)
  To: ptxdist

On Mon, Jan 06, 2020 at 11:59:56AM +0100, Michael Olbrich wrote:
> On Fri, Dec 06, 2019 at 11:36:13AM +0100, Ladislav Michl wrote:
> > Let OpenVPN use ip command when BUSYBOX_IP is not selected. This
> > allows OpenVPN to be used in Busybox-less environments.
> 
> Hmmm, what does the -{en,dis}able-iproute2 option do exactly?
> Could we enable it unconditionally or does BUSYBOX_IP not provide all the
> necessary features?

Well, what about using 'ip' by default and legacy interface as a fallback?

--- 8< ---

From: Ladislav Michl <ladis@linux-mips.org>
Subject: [PATCH] openvpn: select IPROUTE2 without BUSYBOX only

OpenVPN can be configured to use 'ip' command by specifying
--enable-iproute2, otherwise legacy net-tools commands 'ifconfig'
and 'route' are used.

Use (rt)netlink interface provided by 'ip' tool by default with
fallback to legacy one. This allows OpenVPN package to be used
in Busybox-less environments without requiring legacy net-tools.

Signed-off-by: Ladislav Michl <ladis@linux-mips.org>
---
 rules/openvpn.in   | 15 ++++++++++-----
 rules/openvpn.make |  2 +-
 2 files changed, 11 insertions(+), 6 deletions(-)

diff --git a/rules/openvpn.in b/rules/openvpn.in
index 6958e2940..37bf36cf4 100644
--- a/rules/openvpn.in
+++ b/rules/openvpn.in
@@ -9,11 +9,12 @@ menuconfig OPENVPN
 	select IPTABLES			if OPENVPN_INSTALL_SAMPLE_CONFIGS && RUNTIME
 	select IPTABLES_INSTALL_TOOLS	if OPENVPN_INSTALL_SAMPLE_CONFIGS && RUNTIME
 	select BRIDGE_UTILS		if OPENVPN_INSTALL_SAMPLE_SCRIPTS && RUNTIME
-	select IPROUTE2			if !BUSYBOX_IP && RUNTIME
-	select IPROUTE2_IP		if !BUSYBOX_IP && RUNTIME
-	select BUSYBOX_IFCONFIG		if RUNTIME
-	select BUSYBOX_NETSTAT		if RUNTIME
-	select BUSYBOX_ROUTE		if RUNTIME
+	select IPROUTE2			if !BUSYBOX && RUNTIME
+	select IPROUTE2_IP		if !BUSYBOX && RUNTIME
+	select BUSYBOX_IFCONFIG		if BUSYBOX && !BUSYBOX_IP && RUNTIME
+	select BUSYBOX_ROUTE		if BUSYBOX && !BUSYBOX_IP && RUNTIME
+	select BUSYBOX_FEATURE_IP_LINK	if BUSYBOX && BUSYBOX_IP && RUNTIME
+	select BUSYBOX_FEATURE_IP_ROUTE	if BUSYBOX && BUSYBOX_IP && RUNTIME
 	help
 	  virtual private network daemon
 
@@ -35,6 +36,10 @@ menuconfig OPENVPN
 
 if OPENVPN
 
+config OPENVPN_IPROUTE2
+	bool
+	default BUSYBOX_IP || IPROUTE2_IP
+
 config OPENVPN_SMALL
 	bool
 	prompt "Enable smaller executable size"
diff --git a/rules/openvpn.make b/rules/openvpn.make
index dc05384df..0c4f99ff2 100644
--- a/rules/openvpn.make
+++ b/rules/openvpn.make
@@ -67,7 +67,7 @@ OPENVPN_CONF_OPT	:= \
 	--enable-port-share \
 	--disable-debug \
 	--$(call ptx/endis, PTXCONF_OPENVPN_SMALL)-small \
-	--disable-iproute2 \
+	--$(call ptx/endis, PTXCONF_OPENVPN_IPROUTE2)-iproute2 \
 	--enable-def-auth \
 	--enable-pf \
 	--disable-plugin-auth-pam \
-- 
2.26.2


_______________________________________________
ptxdist mailing list
ptxdist@pengutronix.de

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [ptxdist] [PATCH] openvpn: allow use of iproute2
  2020-05-13 10:39   ` Ladislav Michl
@ 2020-05-26 12:01     ` Ladislav Michl
  2020-05-27  8:24       ` Roland Hieber
  2020-05-29  8:02     ` Michael Olbrich
  1 sibling, 1 reply; 9+ messages in thread
From: Ladislav Michl @ 2020-05-26 12:01 UTC (permalink / raw)
  To: ptxdist

Gentle ping...

On Wed, May 13, 2020 at 12:39:10PM +0200, Ladislav Michl wrote:
> On Mon, Jan 06, 2020 at 11:59:56AM +0100, Michael Olbrich wrote:
> > On Fri, Dec 06, 2019 at 11:36:13AM +0100, Ladislav Michl wrote:
> > > Let OpenVPN use ip command when BUSYBOX_IP is not selected. This
> > > allows OpenVPN to be used in Busybox-less environments.
> > 
> > Hmmm, what does the -{en,dis}able-iproute2 option do exactly?
> > Could we enable it unconditionally or does BUSYBOX_IP not provide all the
> > necessary features?
> 
> Well, what about using 'ip' by default and legacy interface as a fallback?

Any other idea to support openvpn in busybox-less setup is welcome as well ;-)

> --- 8< ---
> 
> From: Ladislav Michl <ladis@linux-mips.org>
> Subject: [PATCH] openvpn: select IPROUTE2 without BUSYBOX only
> 
> OpenVPN can be configured to use 'ip' command by specifying
> --enable-iproute2, otherwise legacy net-tools commands 'ifconfig'
> and 'route' are used.
> 
> Use (rt)netlink interface provided by 'ip' tool by default with
> fallback to legacy one. This allows OpenVPN package to be used
> in Busybox-less environments without requiring legacy net-tools.
> 
> Signed-off-by: Ladislav Michl <ladis@linux-mips.org>
> ---
>  rules/openvpn.in   | 15 ++++++++++-----
>  rules/openvpn.make |  2 +-
>  2 files changed, 11 insertions(+), 6 deletions(-)
> 
> diff --git a/rules/openvpn.in b/rules/openvpn.in
> index 6958e2940..37bf36cf4 100644
> --- a/rules/openvpn.in
> +++ b/rules/openvpn.in
> @@ -9,11 +9,12 @@ menuconfig OPENVPN
>  	select IPTABLES			if OPENVPN_INSTALL_SAMPLE_CONFIGS && RUNTIME
>  	select IPTABLES_INSTALL_TOOLS	if OPENVPN_INSTALL_SAMPLE_CONFIGS && RUNTIME
>  	select BRIDGE_UTILS		if OPENVPN_INSTALL_SAMPLE_SCRIPTS && RUNTIME
> -	select IPROUTE2			if !BUSYBOX_IP && RUNTIME
> -	select IPROUTE2_IP		if !BUSYBOX_IP && RUNTIME
> -	select BUSYBOX_IFCONFIG		if RUNTIME
> -	select BUSYBOX_NETSTAT		if RUNTIME
> -	select BUSYBOX_ROUTE		if RUNTIME
> +	select IPROUTE2			if !BUSYBOX && RUNTIME
> +	select IPROUTE2_IP		if !BUSYBOX && RUNTIME
> +	select BUSYBOX_IFCONFIG		if BUSYBOX && !BUSYBOX_IP && RUNTIME
> +	select BUSYBOX_ROUTE		if BUSYBOX && !BUSYBOX_IP && RUNTIME
> +	select BUSYBOX_FEATURE_IP_LINK	if BUSYBOX && BUSYBOX_IP && RUNTIME
> +	select BUSYBOX_FEATURE_IP_ROUTE	if BUSYBOX && BUSYBOX_IP && RUNTIME
>  	help
>  	  virtual private network daemon
>  
> @@ -35,6 +36,10 @@ menuconfig OPENVPN
>  
>  if OPENVPN
>  
> +config OPENVPN_IPROUTE2
> +	bool
> +	default BUSYBOX_IP || IPROUTE2_IP
> +
>  config OPENVPN_SMALL
>  	bool
>  	prompt "Enable smaller executable size"
> diff --git a/rules/openvpn.make b/rules/openvpn.make
> index dc05384df..0c4f99ff2 100644
> --- a/rules/openvpn.make
> +++ b/rules/openvpn.make
> @@ -67,7 +67,7 @@ OPENVPN_CONF_OPT	:= \
>  	--enable-port-share \
>  	--disable-debug \
>  	--$(call ptx/endis, PTXCONF_OPENVPN_SMALL)-small \
> -	--disable-iproute2 \
> +	--$(call ptx/endis, PTXCONF_OPENVPN_IPROUTE2)-iproute2 \
>  	--enable-def-auth \
>  	--enable-pf \
>  	--disable-plugin-auth-pam \
> -- 
> 2.26.2
> 
> 
> _______________________________________________
> ptxdist mailing list
> ptxdist@pengutronix.de

_______________________________________________
ptxdist mailing list
ptxdist@pengutronix.de

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [ptxdist] [PATCH] openvpn: allow use of iproute2
  2020-05-26 12:01     ` Ladislav Michl
@ 2020-05-27  8:24       ` Roland Hieber
  0 siblings, 0 replies; 9+ messages in thread
From: Roland Hieber @ 2020-05-27  8:24 UTC (permalink / raw)
  To: Ladislav Michl; +Cc: ptxdist

On Tue, May 26, 2020 at 02:01:43PM +0200, Ladislav Michl wrote:
> Gentle ping...
> 
> On Wed, May 13, 2020 at 12:39:10PM +0200, Ladislav Michl wrote:
> > On Mon, Jan 06, 2020 at 11:59:56AM +0100, Michael Olbrich wrote:
> > > On Fri, Dec 06, 2019 at 11:36:13AM +0100, Ladislav Michl wrote:
> > > > Let OpenVPN use ip command when BUSYBOX_IP is not selected. This
> > > > allows OpenVPN to be used in Busybox-less environments.
> > > 
> > > Hmmm, what does the -{en,dis}able-iproute2 option do exactly?
> > > Could we enable it unconditionally or does BUSYBOX_IP not provide all the
> > > necessary features?
> > 
> > Well, what about using 'ip' by default and legacy interface as a fallback?
> 
> Any other idea to support openvpn in busybox-less setup is welcome as well ;-)

For the record, your patch made sense to me, but I haven't tested it.

 - Roland

> > --- 8< ---
> > 
> > From: Ladislav Michl <ladis@linux-mips.org>
> > Subject: [PATCH] openvpn: select IPROUTE2 without BUSYBOX only
> > 
> > OpenVPN can be configured to use 'ip' command by specifying
> > --enable-iproute2, otherwise legacy net-tools commands 'ifconfig'
> > and 'route' are used.
> > 
> > Use (rt)netlink interface provided by 'ip' tool by default with
> > fallback to legacy one. This allows OpenVPN package to be used
> > in Busybox-less environments without requiring legacy net-tools.
> > 
> > Signed-off-by: Ladislav Michl <ladis@linux-mips.org>
> > ---
> >  rules/openvpn.in   | 15 ++++++++++-----
> >  rules/openvpn.make |  2 +-
> >  2 files changed, 11 insertions(+), 6 deletions(-)
> > 
> > diff --git a/rules/openvpn.in b/rules/openvpn.in
> > index 6958e2940..37bf36cf4 100644
> > --- a/rules/openvpn.in
> > +++ b/rules/openvpn.in
> > @@ -9,11 +9,12 @@ menuconfig OPENVPN
> >  	select IPTABLES			if OPENVPN_INSTALL_SAMPLE_CONFIGS && RUNTIME
> >  	select IPTABLES_INSTALL_TOOLS	if OPENVPN_INSTALL_SAMPLE_CONFIGS && RUNTIME
> >  	select BRIDGE_UTILS		if OPENVPN_INSTALL_SAMPLE_SCRIPTS && RUNTIME
> > -	select IPROUTE2			if !BUSYBOX_IP && RUNTIME
> > -	select IPROUTE2_IP		if !BUSYBOX_IP && RUNTIME
> > -	select BUSYBOX_IFCONFIG		if RUNTIME
> > -	select BUSYBOX_NETSTAT		if RUNTIME
> > -	select BUSYBOX_ROUTE		if RUNTIME
> > +	select IPROUTE2			if !BUSYBOX && RUNTIME
> > +	select IPROUTE2_IP		if !BUSYBOX && RUNTIME
> > +	select BUSYBOX_IFCONFIG		if BUSYBOX && !BUSYBOX_IP && RUNTIME
> > +	select BUSYBOX_ROUTE		if BUSYBOX && !BUSYBOX_IP && RUNTIME
> > +	select BUSYBOX_FEATURE_IP_LINK	if BUSYBOX && BUSYBOX_IP && RUNTIME
> > +	select BUSYBOX_FEATURE_IP_ROUTE	if BUSYBOX && BUSYBOX_IP && RUNTIME
> >  	help
> >  	  virtual private network daemon
> >  
> > @@ -35,6 +36,10 @@ menuconfig OPENVPN
> >  
> >  if OPENVPN
> >  
> > +config OPENVPN_IPROUTE2
> > +	bool
> > +	default BUSYBOX_IP || IPROUTE2_IP
> > +
> >  config OPENVPN_SMALL
> >  	bool
> >  	prompt "Enable smaller executable size"
> > diff --git a/rules/openvpn.make b/rules/openvpn.make
> > index dc05384df..0c4f99ff2 100644
> > --- a/rules/openvpn.make
> > +++ b/rules/openvpn.make
> > @@ -67,7 +67,7 @@ OPENVPN_CONF_OPT	:= \
> >  	--enable-port-share \
> >  	--disable-debug \
> >  	--$(call ptx/endis, PTXCONF_OPENVPN_SMALL)-small \
> > -	--disable-iproute2 \
> > +	--$(call ptx/endis, PTXCONF_OPENVPN_IPROUTE2)-iproute2 \
> >  	--enable-def-auth \
> >  	--enable-pf \
> >  	--disable-plugin-auth-pam \
> > -- 
> > 2.26.2
> > 
> > 
> > _______________________________________________
> > ptxdist mailing list
> > ptxdist@pengutronix.de
> 
> _______________________________________________
> ptxdist mailing list
> ptxdist@pengutronix.de
> 

-- 
Roland Hieber, Pengutronix e.K.          | r.hieber@pengutronix.de     |
Steuerwalder Str. 21                     | https://www.pengutronix.de/ |
31137 Hildesheim, Germany                | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686         | Fax:   +49-5121-206917-5555 |

_______________________________________________
ptxdist mailing list
ptxdist@pengutronix.de

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [ptxdist] [PATCH] openvpn: allow use of iproute2
  2020-05-13 10:39   ` Ladislav Michl
  2020-05-26 12:01     ` Ladislav Michl
@ 2020-05-29  8:02     ` Michael Olbrich
  2020-06-01  8:47       ` Ladislav Michl
  1 sibling, 1 reply; 9+ messages in thread
From: Michael Olbrich @ 2020-05-29  8:02 UTC (permalink / raw)
  To: ptxdist

On Wed, May 13, 2020 at 12:39:10PM +0200, Ladislav Michl wrote:
> On Mon, Jan 06, 2020 at 11:59:56AM +0100, Michael Olbrich wrote:
> > On Fri, Dec 06, 2019 at 11:36:13AM +0100, Ladislav Michl wrote:
> > > Let OpenVPN use ip command when BUSYBOX_IP is not selected. This
> > > allows OpenVPN to be used in Busybox-less environments.
> > 
> > Hmmm, what does the -{en,dis}able-iproute2 option do exactly?
> > Could we enable it unconditionally or does BUSYBOX_IP not provide all the
> > necessary features?
> 
> Well, what about using 'ip' by default and legacy interface as a fallback?

I looked into the code and I didn't see anything that busybox ip cannot
handle. So please keep it simple and drop the fallback.

Michael

> --- 8< ---
> 
> From: Ladislav Michl <ladis@linux-mips.org>
> Subject: [PATCH] openvpn: select IPROUTE2 without BUSYBOX only
> 
> OpenVPN can be configured to use 'ip' command by specifying
> --enable-iproute2, otherwise legacy net-tools commands 'ifconfig'
> and 'route' are used.
> 
> Use (rt)netlink interface provided by 'ip' tool by default with
> fallback to legacy one. This allows OpenVPN package to be used
> in Busybox-less environments without requiring legacy net-tools.
> 
> Signed-off-by: Ladislav Michl <ladis@linux-mips.org>
> ---
>  rules/openvpn.in   | 15 ++++++++++-----
>  rules/openvpn.make |  2 +-
>  2 files changed, 11 insertions(+), 6 deletions(-)
> 
> diff --git a/rules/openvpn.in b/rules/openvpn.in
> index 6958e2940..37bf36cf4 100644
> --- a/rules/openvpn.in
> +++ b/rules/openvpn.in
> @@ -9,11 +9,12 @@ menuconfig OPENVPN
>  	select IPTABLES			if OPENVPN_INSTALL_SAMPLE_CONFIGS && RUNTIME
>  	select IPTABLES_INSTALL_TOOLS	if OPENVPN_INSTALL_SAMPLE_CONFIGS && RUNTIME
>  	select BRIDGE_UTILS		if OPENVPN_INSTALL_SAMPLE_SCRIPTS && RUNTIME
> -	select IPROUTE2			if !BUSYBOX_IP && RUNTIME
> -	select IPROUTE2_IP		if !BUSYBOX_IP && RUNTIME
> -	select BUSYBOX_IFCONFIG		if RUNTIME
> -	select BUSYBOX_NETSTAT		if RUNTIME
> -	select BUSYBOX_ROUTE		if RUNTIME
> +	select IPROUTE2			if !BUSYBOX && RUNTIME
> +	select IPROUTE2_IP		if !BUSYBOX && RUNTIME
> +	select BUSYBOX_IFCONFIG		if BUSYBOX && !BUSYBOX_IP && RUNTIME
> +	select BUSYBOX_ROUTE		if BUSYBOX && !BUSYBOX_IP && RUNTIME
> +	select BUSYBOX_FEATURE_IP_LINK	if BUSYBOX && BUSYBOX_IP && RUNTIME
> +	select BUSYBOX_FEATURE_IP_ROUTE	if BUSYBOX && BUSYBOX_IP && RUNTIME
>  	help
>  	  virtual private network daemon
>  
> @@ -35,6 +36,10 @@ menuconfig OPENVPN
>  
>  if OPENVPN
>  
> +config OPENVPN_IPROUTE2
> +	bool
> +	default BUSYBOX_IP || IPROUTE2_IP
> +
>  config OPENVPN_SMALL
>  	bool
>  	prompt "Enable smaller executable size"
> diff --git a/rules/openvpn.make b/rules/openvpn.make
> index dc05384df..0c4f99ff2 100644
> --- a/rules/openvpn.make
> +++ b/rules/openvpn.make
> @@ -67,7 +67,7 @@ OPENVPN_CONF_OPT	:= \
>  	--enable-port-share \
>  	--disable-debug \
>  	--$(call ptx/endis, PTXCONF_OPENVPN_SMALL)-small \
> -	--disable-iproute2 \
> +	--$(call ptx/endis, PTXCONF_OPENVPN_IPROUTE2)-iproute2 \
>  	--enable-def-auth \
>  	--enable-pf \
>  	--disable-plugin-auth-pam \
> -- 
> 2.26.2
> 
> 
> _______________________________________________
> ptxdist mailing list
> ptxdist@pengutronix.de
> 

-- 
Pengutronix e.K.                           |                             |
Steuerwalder Str. 21                       | http://www.pengutronix.de/  |
31137 Hildesheim, Germany                  | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

_______________________________________________
ptxdist mailing list
ptxdist@pengutronix.de
To unsubscribe, send a mail with subject "unsubscribe" to ptxdist-request@pengutronix.de

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [ptxdist] [PATCH] openvpn: allow use of iproute2
  2020-05-29  8:02     ` Michael Olbrich
@ 2020-06-01  8:47       ` Ladislav Michl
  2020-06-02  8:13         ` Michael Olbrich
  0 siblings, 1 reply; 9+ messages in thread
From: Ladislav Michl @ 2020-06-01  8:47 UTC (permalink / raw)
  To: ptxdist

On Fri, May 29, 2020 at 10:02:43AM +0200, Michael Olbrich wrote:
> On Wed, May 13, 2020 at 12:39:10PM +0200, Ladislav Michl wrote:
> > On Mon, Jan 06, 2020 at 11:59:56AM +0100, Michael Olbrich wrote:
> > > On Fri, Dec 06, 2019 at 11:36:13AM +0100, Ladislav Michl wrote:
> > > > Let OpenVPN use ip command when BUSYBOX_IP is not selected. This
> > > > allows OpenVPN to be used in Busybox-less environments.
> > > 
> > > Hmmm, what does the -{en,dis}able-iproute2 option do exactly?
> > > Could we enable it unconditionally or does BUSYBOX_IP not provide all the
> > > necessary features?
> > 
> > Well, what about using 'ip' by default and legacy interface as a fallback?
> 
> I looked into the code and I didn't see anything that busybox ip cannot
> handle. So please keep it simple and drop the fallback.

Hmm, that would probably require some more magic as BUSYBOX_FEATURE_IP_LINK
is not selected...
Btw, looked at other packages, this is quite common problem - rauc selects
BUSYBOX_FEATURE_TAR_LONG_OPTIONS if BUSYBOX_TAR, but does not select tar
itself (neither GNU nor Busybox one)

diff --git a/rules/openvpn.in b/rules/openvpn.in
index 6958e2940..579c0314e 100644
--- a/rules/openvpn.in
+++ b/rules/openvpn.in
@@ -9,11 +9,11 @@ menuconfig OPENVPN
 	select IPTABLES			if OPENVPN_INSTALL_SAMPLE_CONFIGS && RUNTIME
 	select IPTABLES_INSTALL_TOOLS	if OPENVPN_INSTALL_SAMPLE_CONFIGS && RUNTIME
 	select BRIDGE_UTILS		if OPENVPN_INSTALL_SAMPLE_SCRIPTS && RUNTIME
+	select BUSYBOX_IP		if BUSYBOX && !IPROUTE2_IP && RUNTIME
+	select BUSYBOX_FEATURE_IP_LINK	if BUSYBOX && BUSYBOX_IP && RUNTIME
+	select BUSYBOX_FEATURE_IP_ROUTE	if BUSYBOX && BUSYBOX_IP && RUNTIME
 	select IPROUTE2			if !BUSYBOX_IP && RUNTIME
 	select IPROUTE2_IP		if !BUSYBOX_IP && RUNTIME
-	select BUSYBOX_IFCONFIG		if RUNTIME
-	select BUSYBOX_NETSTAT		if RUNTIME
-	select BUSYBOX_ROUTE		if RUNTIME
 	help
 	  virtual private network daemon
 

_______________________________________________
ptxdist mailing list
ptxdist@pengutronix.de
To unsubscribe, send a mail with subject "unsubscribe" to ptxdist-request@pengutronix.de

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [ptxdist] [PATCH] openvpn: allow use of iproute2
  2020-06-01  8:47       ` Ladislav Michl
@ 2020-06-02  8:13         ` Michael Olbrich
  2020-06-02 21:03           ` Ladislav Michl
  0 siblings, 1 reply; 9+ messages in thread
From: Michael Olbrich @ 2020-06-02  8:13 UTC (permalink / raw)
  To: ptxdist

On Mon, Jun 01, 2020 at 10:47:59AM +0200, Ladislav Michl wrote:
> On Fri, May 29, 2020 at 10:02:43AM +0200, Michael Olbrich wrote:
> > On Wed, May 13, 2020 at 12:39:10PM +0200, Ladislav Michl wrote:
> > > On Mon, Jan 06, 2020 at 11:59:56AM +0100, Michael Olbrich wrote:
> > > > On Fri, Dec 06, 2019 at 11:36:13AM +0100, Ladislav Michl wrote:
> > > > > Let OpenVPN use ip command when BUSYBOX_IP is not selected. This
> > > > > allows OpenVPN to be used in Busybox-less environments.
> > > > 
> > > > Hmmm, what does the -{en,dis}able-iproute2 option do exactly?
> > > > Could we enable it unconditionally or does BUSYBOX_IP not provide all the
> > > > necessary features?
> > > 
> > > Well, what about using 'ip' by default and legacy interface as a fallback?
> > 
> > I looked into the code and I didn't see anything that busybox ip cannot
> > handle. So please keep it simple and drop the fallback.
> 
> Hmm, that would probably require some more magic as BUSYBOX_FEATURE_IP_LINK
> is not selected...
> Btw, looked at other packages, this is quite common problem - rauc selects
> BUSYBOX_FEATURE_TAR_LONG_OPTIONS if BUSYBOX_TAR, but does not select tar
> itself (neither GNU nor Busybox one)

Did you test the hunk below? I think this results in a cyclic dependency
error. And that's the problem in general. There is no good way to specify
'select A or B'. And 'select BUSYBOX_IP if BUSYBOX' is not good either. I
have seen use-cases that use busybox for all kinds of stuff but need the
features from the 'real' ip.
I think, just add the 'select BUSYBOX_FEATURE_IP_* ...' lines. That should
result in something that works.

Michael

> diff --git a/rules/openvpn.in b/rules/openvpn.in
> index 6958e2940..579c0314e 100644
> --- a/rules/openvpn.in
> +++ b/rules/openvpn.in
> @@ -9,11 +9,11 @@ menuconfig OPENVPN
>  	select IPTABLES			if OPENVPN_INSTALL_SAMPLE_CONFIGS && RUNTIME
>  	select IPTABLES_INSTALL_TOOLS	if OPENVPN_INSTALL_SAMPLE_CONFIGS && RUNTIME
>  	select BRIDGE_UTILS		if OPENVPN_INSTALL_SAMPLE_SCRIPTS && RUNTIME
> +	select BUSYBOX_IP		if BUSYBOX && !IPROUTE2_IP && RUNTIME
> +	select BUSYBOX_FEATURE_IP_LINK	if BUSYBOX && BUSYBOX_IP && RUNTIME
> +	select BUSYBOX_FEATURE_IP_ROUTE	if BUSYBOX && BUSYBOX_IP && RUNTIME
>  	select IPROUTE2			if !BUSYBOX_IP && RUNTIME
>  	select IPROUTE2_IP		if !BUSYBOX_IP && RUNTIME
> -	select BUSYBOX_IFCONFIG		if RUNTIME
> -	select BUSYBOX_NETSTAT		if RUNTIME
> -	select BUSYBOX_ROUTE		if RUNTIME
>  	help
>  	  virtual private network daemon
>  
> 
> _______________________________________________
> ptxdist mailing list
> ptxdist@pengutronix.de
> To unsubscribe, send a mail with subject "unsubscribe" to ptxdist-request@pengutronix.de
> 

-- 
Pengutronix e.K.                           |                             |
Steuerwalder Str. 21                       | http://www.pengutronix.de/  |
31137 Hildesheim, Germany                  | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

_______________________________________________
ptxdist mailing list
ptxdist@pengutronix.de
To unsubscribe, send a mail with subject "unsubscribe" to ptxdist-request@pengutronix.de

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [ptxdist] [PATCH] openvpn: allow use of iproute2
  2020-06-02  8:13         ` Michael Olbrich
@ 2020-06-02 21:03           ` Ladislav Michl
  0 siblings, 0 replies; 9+ messages in thread
From: Ladislav Michl @ 2020-06-02 21:03 UTC (permalink / raw)
  To: ptxdist

On Tue, Jun 02, 2020 at 10:13:36AM +0200, Michael Olbrich wrote:
> On Mon, Jun 01, 2020 at 10:47:59AM +0200, Ladislav Michl wrote:
> > On Fri, May 29, 2020 at 10:02:43AM +0200, Michael Olbrich wrote:
> > > On Wed, May 13, 2020 at 12:39:10PM +0200, Ladislav Michl wrote:
> > > > On Mon, Jan 06, 2020 at 11:59:56AM +0100, Michael Olbrich wrote:
> > > > > On Fri, Dec 06, 2019 at 11:36:13AM +0100, Ladislav Michl wrote:
> > > > > > Let OpenVPN use ip command when BUSYBOX_IP is not selected. This
> > > > > > allows OpenVPN to be used in Busybox-less environments.
> > > > > 
> > > > > Hmmm, what does the -{en,dis}able-iproute2 option do exactly?
> > > > > Could we enable it unconditionally or does BUSYBOX_IP not provide all the
> > > > > necessary features?
> > > > 
> > > > Well, what about using 'ip' by default and legacy interface as a fallback?
> > > 
> > > I looked into the code and I didn't see anything that busybox ip cannot
> > > handle. So please keep it simple and drop the fallback.
> > 
> > Hmm, that would probably require some more magic as BUSYBOX_FEATURE_IP_LINK
> > is not selected...
> > Btw, looked at other packages, this is quite common problem - rauc selects
> > BUSYBOX_FEATURE_TAR_LONG_OPTIONS if BUSYBOX_TAR, but does not select tar
> > itself (neither GNU nor Busybox one)
> 
> Did you test the hunk below? I think this results in a cyclic dependency
> error. And that's the problem in general. There is no good way to specify
> 'select A or B'. And 'select BUSYBOX_IP if BUSYBOX' is not good either. I
> have seen use-cases that use busybox for all kinds of stuff but need the
> features from the 'real' ip.

Tested, no error, but BUSYBOX_IP is not selected. Strangely enough it
selects IPROUTE2_IP when BUSYBOX_IP is configured out.

Idea was to select IPROUTE2_IP only when already used exactly not to break
use-cases you mentioned above.

> I think, just add the 'select BUSYBOX_FEATURE_IP_* ...' lines. That should
> result in something that works.

That works only if:
1) BUSYBOX_IP is already selected
2) or IPROUTE2_IP is already selected

I also tried IP as virtual package, but that's just messy overkill.
So unless there's a better solution, I'll mention need to select 'ip'
in the help text and be done with that.

...or we could mention that in the comment:
--- a/rules/openvpn.in
+++ b/rules/openvpn.in
@@ -9,11 +9,10 @@ menuconfig OPENVPN
 	select IPTABLES			if OPENVPN_INSTALL_SAMPLE_CONFIGS && RUNTIME
 	select IPTABLES_INSTALL_TOOLS	if OPENVPN_INSTALL_SAMPLE_CONFIGS && RUNTIME
 	select BRIDGE_UTILS		if OPENVPN_INSTALL_SAMPLE_SCRIPTS && RUNTIME
+	select BUSYBOX_FEATURE_IP_LINK	if BUSYBOX && BUSYBOX_IP && RUNTIME
+	select BUSYBOX_FEATURE_IP_ROUTE	if BUSYBOX && BUSYBOX_IP && RUNTIME
 	select IPROUTE2			if !BUSYBOX_IP && RUNTIME
 	select IPROUTE2_IP		if !BUSYBOX_IP && RUNTIME
-	select BUSYBOX_IFCONFIG		if RUNTIME
-	select BUSYBOX_NETSTAT		if RUNTIME
-	select BUSYBOX_ROUTE		if RUNTIME
 	help
 	  virtual private network daemon
 
@@ -35,6 +34,9 @@ menuconfig OPENVPN
 
 if OPENVPN
 
+comment "Select either BUSYBOX_IP or IPROUTE2_IP!"
+	depends on !BUSYBOX_IP && !IPROUTE2_IP
+
 config OPENVPN_SMALL
 	bool
 	prompt "Enable smaller executable size"

> Michael
> 
> > diff --git a/rules/openvpn.in b/rules/openvpn.in
> > index 6958e2940..579c0314e 100644
> > --- a/rules/openvpn.in
> > +++ b/rules/openvpn.in
> > @@ -9,11 +9,11 @@ menuconfig OPENVPN
> >  	select IPTABLES			if OPENVPN_INSTALL_SAMPLE_CONFIGS && RUNTIME
> >  	select IPTABLES_INSTALL_TOOLS	if OPENVPN_INSTALL_SAMPLE_CONFIGS && RUNTIME
> >  	select BRIDGE_UTILS		if OPENVPN_INSTALL_SAMPLE_SCRIPTS && RUNTIME
> > +	select BUSYBOX_IP		if BUSYBOX && !IPROUTE2_IP && RUNTIME
> > +	select BUSYBOX_FEATURE_IP_LINK	if BUSYBOX && BUSYBOX_IP && RUNTIME
> > +	select BUSYBOX_FEATURE_IP_ROUTE	if BUSYBOX && BUSYBOX_IP && RUNTIME
> >  	select IPROUTE2			if !BUSYBOX_IP && RUNTIME
> >  	select IPROUTE2_IP		if !BUSYBOX_IP && RUNTIME
> > -	select BUSYBOX_IFCONFIG		if RUNTIME
> > -	select BUSYBOX_NETSTAT		if RUNTIME
> > -	select BUSYBOX_ROUTE		if RUNTIME
> >  	help
> >  	  virtual private network daemon
> >  
> > 
> > _______________________________________________
> > ptxdist mailing list
> > ptxdist@pengutronix.de
> > To unsubscribe, send a mail with subject "unsubscribe" to ptxdist-request@pengutronix.de
> > 
> 
> -- 
> Pengutronix e.K.                           |                             |
> Steuerwalder Str. 21                       | http://www.pengutronix.de/  |
> 31137 Hildesheim, Germany                  | Phone: +49-5121-206917-0    |
> Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |
> 
> _______________________________________________
> ptxdist mailing list
> ptxdist@pengutronix.de
> To unsubscribe, send a mail with subject "unsubscribe" to ptxdist-request@pengutronix.de

_______________________________________________
ptxdist mailing list
ptxdist@pengutronix.de
To unsubscribe, send a mail with subject "unsubscribe" to ptxdist-request@pengutronix.de

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2020-06-02 21:03 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-12-06 10:36 [ptxdist] [PATCH] openvpn: allow use of iproute2 Ladislav Michl
2020-01-06 10:59 ` Michael Olbrich
2020-05-13 10:39   ` Ladislav Michl
2020-05-26 12:01     ` Ladislav Michl
2020-05-27  8:24       ` Roland Hieber
2020-05-29  8:02     ` Michael Olbrich
2020-06-01  8:47       ` Ladislav Michl
2020-06-02  8:13         ` Michael Olbrich
2020-06-02 21:03           ` Ladislav Michl

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox