diff options
author | Arne Schwabe <arne@rfc2549.org> | 2012-04-30 22:56:09 +0200 |
---|---|---|
committer | Arne Schwabe <arne@rfc2549.org> | 2012-04-30 22:56:09 +0200 |
commit | 370fa3686c7bfa74ed4b26c253ad0ba391bd34c4 (patch) | |
tree | 375f387d4f4cc0a3e39e86d9b6f86155e3dbae84 /src/de/blinkt/openvpn/OpenVpnService.java | |
parent | 273e83fee509d80f3bd0fd485dd0c49f7c12c32a (diff) |
Version 0.4.6 - Codename "Welcome to the world people in 2012, where we use CIDR"
Diffstat (limited to 'src/de/blinkt/openvpn/OpenVpnService.java')
-rw-r--r-- | src/de/blinkt/openvpn/OpenVpnService.java | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/de/blinkt/openvpn/OpenVpnService.java b/src/de/blinkt/openvpn/OpenVpnService.java index 8da49bad..442fd94c 100644 --- a/src/de/blinkt/openvpn/OpenVpnService.java +++ b/src/de/blinkt/openvpn/OpenVpnService.java @@ -202,7 +202,11 @@ public class OpenVpnService extends VpnService implements Handler.Callback { for (CIDRIP route:mRoutes) { - builder.addRoute(route.mIp, route.len); + try { + builder.addRoute(route.mIp, route.len); + } catch (IllegalArgumentException ia) { + OpenVPN.logMessage(0, "", getString(R.string.route_rejected) + route + " " + ia.getLocalizedMessage()); + } } if(mDomain!=null) @@ -243,6 +247,9 @@ public class OpenVpnService extends VpnService implements Handler.Callback { public void setLocalIP(String local, String netmask) { mLocalIP = new CIDRIP(local, netmask); + if(mLocalIP.len == 32 && !netmask.equals("255.255.255.255")) { + OpenVPN.logMessage(0, "", String.format(getString(R.string.ip_not_cidr, local,netmask))); + } } |