summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArne Schwabe <arne@rfc2549.org>2014-10-19 21:24:09 +0200
committerArne Schwabe <arne@rfc2549.org>2014-10-19 21:24:09 +0200
commitd6fc599a25ac5706b6179ba49ee2ce4331bc2b93 (patch)
treedc019ab0d77fa1914e3faa369a2f0d4a8d13b75a
parentcfc02dd036561460dbb88ed371998704c4d5842f (diff)
Fix redirect-gateway if /proc/net/route cannot be read
-rwxr-xr-xmain/misc/build-native.sh2
-rw-r--r--main/openvpn/config-version.h2
-rw-r--r--main/openvpn/src/openvpn/route.c13
3 files changed, 15 insertions, 2 deletions
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 */