From d6fc599a25ac5706b6179ba49ee2ce4331bc2b93 Mon Sep 17 00:00:00 2001 From: Arne Schwabe Date: Sun, 19 Oct 2014 21:24:09 +0200 Subject: Fix redirect-gateway if /proc/net/route cannot be read --- main/misc/build-native.sh | 2 +- main/openvpn/config-version.h | 2 +- main/openvpn/src/openvpn/route.c | 13 +++++++++++++ 3 files changed, 15 insertions(+), 2 deletions(-) (limited to 'main') diff --git a/main/misc/build-native.sh b/main/misc/build-native.sh index f27384cd..7382efc9 100755 --- a/main/misc/build-native.sh +++ b/main/misc/build-native.sh @@ -23,7 +23,7 @@ if [ -d openvpn/.git ]; then fi if [ "x$1" = "x" ]; then - ndk-build APP_API=all -j 8 + ndk-build -j 8 USE_BREAKPAD=0 else ndk-build $@ fi diff --git a/main/openvpn/config-version.h b/main/openvpn/config-version.h index ff7575de..61285e2f 100644 --- a/main/openvpn/config-version.h +++ b/main/openvpn/config-version.h @@ -1,2 +1,2 @@ -#define CONFIGURE_GIT_REVISION "icsopenvpn_619-c77887f504ec4f11" +#define CONFIGURE_GIT_REVISION "icsopenvpn_619-5e33ca4c82137c4c" #define CONFIGURE_GIT_FLAGS "" diff --git a/main/openvpn/src/openvpn/route.c b/main/openvpn/src/openvpn/route.c index e8bdcff7..c330169a 100644 --- a/main/openvpn/src/openvpn/route.c +++ b/main/openvpn/src/openvpn/route.c @@ -863,10 +863,12 @@ redirect_default_route_to_vpn (struct route_list *rl, const struct tuntap *tt, u { msg (M_WARN, "%s VPN gateway parameter (--route-gateway or --ifconfig) is missing", err); } +#ifndef TARGET_ANDROID else if (!(rl->rgi.flags & RGI_ADDR_DEFINED)) { msg (M_WARN, "%s Cannot read current default gateway from system", err); } +#endif else if (!(rl->spec.flags & RTSA_REMOTE_HOST)) { msg (M_WARN, "%s Cannot obtain current remote host address", err); @@ -913,6 +915,16 @@ redirect_default_route_to_vpn (struct route_list *rl, const struct tuntap *tt, u if (rl->flags & RG_REROUTE_GW) { +#ifdef TARGET_ANDROID + add_route3 (0, + 0, + rl->spec.remote_endpoint, + tt, + flags, + &rl->rgi, + es); + +#else if (rl->flags & RG_DEF1) { /* add new default route (1st component) */ @@ -953,6 +965,7 @@ redirect_default_route_to_vpn (struct route_list *rl, const struct tuntap *tt, u &rl->rgi, es); } +#endif } /* set a flag so we can undo later */ -- cgit v1.2.3