Skip to contentSkip to conversation

openvpn: adjust iproute2 logic

PATCH Superseded Gustavo Zacarias 2 participants 4 messages Apr 4, 2013 – Apr 7, 2013

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 openvpn: adjust iproute2 logic

As reported in bug #6164 when using busybox iproute2 openvpn can fail to locate the 'ip' utility.
This was correct until busybox 1.21.0 was released since it changed the location of /bin/ip to /sbin/ip (what iproute2 proper does). So adjust the ip path accordingly.

---
 package/openvpn/openvpn.mk | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)
package/openvpn/openvpn.mk +7 -3
index c911465..28f7238 100644
@@ -17,10 +17,14 @@ OPENVPN_CONF_OPT += --enable-small --disable-plugins \
 	--disable-debug --disable-eurephia
 endif
 
-ifeq ($(BR2_PACKAGE_IPROUTE2),y)
-OPENVPN_CONF_ENV += IPROUTE=/sbin/ip
-else
+# Busybox 1.21+ places the ip applet in the "correct" place
+# but previous versions didn't.
+ifneq ($(BR2_PACKAGE_IPROUTE2),y)
+ifneq ($(BR2_PACKAGE_BUSYBOX_VERSION_1_21_X),y)
 OPENVPN_CONF_ENV += IPROUTE=/bin/ip
+else
+OPENVPN_CONF_ENV += IPROUTE=/sbin/ip
+endif
 endif
 
 ifeq ($(BR2_PACKAGE_OPENVPN_LZO),y)
Signature · 1 line
1.8.1.5
#1 lore raw

PATCH 1/1 openvpn: adjust iproute2 logic

Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"Gustavo" == Gustavo Zacarias <[email protected]> writes:

Gustavo> As reported in bug #6164 when using busybox iproute2 openvpn can fail to Gustavo> locate the 'ip' utility.
Gustavo> This was correct until busybox 1.21.0 was released since it changed the Gustavo> location of /bin/ip to /sbin/ip (what iproute2 proper does). Gustavo> So adjust the ip path accordingly.

Gustavo> Signed-off-by: Gustavo Zacarias <[email protected]> Gustavo> ---

 Gustavo>  package/openvpn/openvpn.mk | 10 +++++++---

Gustavo> 1 file changed, 7 insertions(+), 3 deletions(-)

Gustavo> diff --git a/package/openvpn/openvpn.mk b/package/openvpn/openvpn.mk Gustavo> index c911465..28f7238 100644
Gustavo> --- a/package/openvpn/openvpn.mk
Gustavo> +++ b/package/openvpn/openvpn.mk
Gustavo> @@ -17,10 +17,14 @@ OPENVPN_CONF_OPT += --enable-small --disable-plugins \
Gustavo> --disable-debug --disable-eurephia
Gustavo> endif

Gustavo> -ifeq ($(BR2_PACKAGE_IPROUTE2),y)
Gustavo> -OPENVPN_CONF_ENV += IPROUTE=/sbin/ip
Gustavo> -else
Gustavo> +# Busybox 1.21+ places the ip applet in the "correct" place Gustavo> +# but previous versions didn't.
Gustavo> +ifneq ($(BR2_PACKAGE_IPROUTE2),y)
Gustavo> +ifneq ($(BR2_PACKAGE_BUSYBOX_VERSION_1_21_X),y)

We'll most likely forget to update this next time we bump the busybox version, and not notice it as it's a runtime issue.

Could you invert the logic so you explicitly check for the old busybox versions instead?

Signature · 1 line
Bye, Peter Korsgaard
#2 lore raw

PATCH 1/1 openvpn: adjust iproute2 logic

Quoted 5 lines · Peter Korsgaard

We'll most likely forget to update this next time we bump the busybox version, and not notice it as it's a runtime issue.

Could you invert the logic so you explicitly check for the old busybox versions instead?

True.
We'll likely forget to remove dead code too later on, but it doesn't hurt :) Regards.

#3 lore raw

PATCH 1/1 openvpn: adjust iproute2 logic

Quoted 4 lines
Quoted 4 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line

"Gustavo" == Gustavo Zacarias <[email protected]> writes:

Could you invert the logic so you explicitly check for the old busybox versions instead?

Gustavo> True.

Gustavo> We'll likely forget to remove dead code too later on, but it Gustavo> doesn't hurt :) Regards.

Indeed, that's a lot less harmful.

Signature · 1 line
Bye, Peter Korsgaard