diff options
author | Arne Schwabe <arne@rfc2549.org> | 2014-12-21 14:58:24 +0100 |
---|---|---|
committer | Arne Schwabe <arne@rfc2549.org> | 2014-12-21 14:58:24 +0100 |
commit | 44721ef08fc4b8cacdbfccb3383f33290bea8733 (patch) | |
tree | 556638ffc6bc4622f1c36abdcf068ebca9a25d1f | |
parent | 3f41bff1180287a04e73380cb10471c92315a1ed (diff) |
Normalise route of local interface (closes issue #311)
-rw-r--r-- | main/src/main/java/de/blinkt/openvpn/core/OpenVPNService.java | 7 |
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... |