summaryrefslogtreecommitdiff
path: root/main/src
diff options
context:
space:
mode:
authorArne Schwabe <arne@rfc2549.org>2014-12-21 14:58:24 +0100
committerArne Schwabe <arne@rfc2549.org>2014-12-21 14:58:24 +0100
commit44721ef08fc4b8cacdbfccb3383f33290bea8733 (patch)
tree556638ffc6bc4622f1c36abdcf068ebca9a25d1f /main/src
parent3f41bff1180287a04e73380cb10471c92315a1ed (diff)
Normalise route of local interface (closes issue #311)
Diffstat (limited to 'main/src')
-rw-r--r--main/src/main/java/de/blinkt/openvpn/core/OpenVPNService.java7
1 files changed, 5 insertions, 2 deletions
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 32b5288e..66b1f72d 100644
--- a/main/src/main/java/de/blinkt/openvpn/core/OpenVPNService.java
+++ b/main/src/main/java/de/blinkt/openvpn/core/OpenVPNService.java
@@ -806,8 +806,11 @@ public class OpenVPNService extends VpnService implements StateListener, Callbac
/* Workaround for Lollipop, it does not route traffic to the VPNs own network mask */
- if (mLocalIP.len <= 31 && Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP)
- addRoute(mLocalIP);
+ if (mLocalIP.len <= 31 && Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
+ CIDRIP interfaceRoute = new CIDRIP(mLocalIP.mIp, mLocalIP.len);
+ interfaceRoute.normalise();
+ addRoute(interfaceRoute);
+ }
// Configurations are sometimes really broken...