diff options
author | Arne Schwabe <arne@rfc2549.org> | 2018-01-18 13:36:49 +0100 |
---|---|---|
committer | Arne Schwabe <arne@rfc2549.org> | 2018-01-18 13:36:49 +0100 |
commit | ede451791d21ca46122cb570424f77f90ee259f4 (patch) | |
tree | fd872937f7db45c5784bf4b2da53c4508c0303c0 | |
parent | 2a45dd558123c5dfdb77358efa1cb1de51b8ce10 (diff) |
Use OpenVPN for Android own route emulation
-rw-r--r-- | main/src/main/cpp/CMakeLists.txt | 2 | ||||
m--------- | main/src/main/cpp/openvpn3 | 0 | ||||
-rw-r--r-- | main/src/main/java/de/blinkt/openvpn/core/OpenVPNService.java | 6 | ||||
-rw-r--r-- | main/src/ovpn3/java/de/blinkt/openvpn/core/OpenVPNThreadv3.java | 6 |
4 files changed, 7 insertions, 7 deletions
diff --git a/main/src/main/cpp/CMakeLists.txt b/main/src/main/cpp/CMakeLists.txt index 89f8457c..318715cb 100644 --- a/main/src/main/cpp/CMakeLists.txt +++ b/main/src/main/cpp/CMakeLists.txt @@ -48,7 +48,7 @@ if (${CMAKE_LIBRARY_OUTPUT_DIRECTORY} MATCHES "build/intermediates/cmake/.*ovpn3 -DUSE_ASIO -DUSE_MBEDTLS -DGIT_VERSION_STRING=\"${OPENVPN3_GIT}\" - + -DNO_ROUTE_EXCLUDE_EMULATION ) target_link_libraries(ovpn3 mbedtls mbedx509 mbedcrypto lzo_static_lib) else() diff --git a/main/src/main/cpp/openvpn3 b/main/src/main/cpp/openvpn3 -Subproject 23cfea815c5180194e475197029cf95800bc91e +Subproject 902ddf9fcda63af73ba3861d0f1fc4a274e2807 diff --git a/main/src/main/java/de/blinkt/openvpn/core/OpenVPNService.java b/main/src/main/java/de/blinkt/openvpn/core/OpenVPNService.java index eb15607d..12b7fba5 100644 --- a/main/src/main/java/de/blinkt/openvpn/core/OpenVPNService.java +++ b/main/src/main/java/de/blinkt/openvpn/core/OpenVPNService.java @@ -935,8 +935,8 @@ public class OpenVPNService extends VpnService implements StateListener, Callbac /** * Route that is always included, used by the v3 core */ - public void addRoute(CIDRIP route) { - mRoutes.addIP(route, true); + public void addRoute(CIDRIP route, boolean include) { + mRoutes.addIP(route, include); } public void addRoute(String dest, String mask, String gateway, String device) { @@ -1037,7 +1037,7 @@ public class OpenVPNService extends VpnService implements StateListener, Callbac if (mLocalIP.len <= 31 && Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) { CIDRIP interfaceRoute = new CIDRIP(mLocalIP.mIp, mLocalIP.len); interfaceRoute.normalise(); - addRoute(interfaceRoute); + addRoute(interfaceRoute ,true); } diff --git a/main/src/ovpn3/java/de/blinkt/openvpn/core/OpenVPNThreadv3.java b/main/src/ovpn3/java/de/blinkt/openvpn/core/OpenVPNThreadv3.java index 62e3a64e..bfe0a999 100644 --- a/main/src/ovpn3/java/de/blinkt/openvpn/core/OpenVPNThreadv3.java +++ b/main/src/ovpn3/java/de/blinkt/openvpn/core/OpenVPNThreadv3.java @@ -105,7 +105,7 @@ public class OpenVPNThreadv3 extends ClientAPI_OpenVPNClient implements Runnable if(ipv6) mService.addRoutev6(address + "/" + prefix_length,"tun"); else - mService.addRoute(new CIDRIP(address, prefix_length)); + mService.addRoute(new CIDRIP(address, prefix_length), true); return true; } @@ -114,8 +114,8 @@ public class OpenVPNThreadv3 extends ClientAPI_OpenVPNClient implements Runnable if(ipv6) mService.addRoutev6(address + "/" + prefix_length, "wifi0"); else { - //TODO - mService.addRoute(address, String.valueOf(prefix_length), "1.2.3.4" , "wifi0"); + CIDRIP route = new CIDRIP(address, prefix_length); + mService.addRoute(route, false); } return true; } |