From 370fa3686c7bfa74ed4b26c253ad0ba391bd34c4 Mon Sep 17 00:00:00 2001 From: Arne Schwabe Date: Mon, 30 Apr 2012 22:56:09 +0200 Subject: Version 0.4.6 - Codename "Welcome to the world people in 2012, where we use CIDR" --- src/de/blinkt/openvpn/OpenVpnService.java | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'src/de/blinkt/openvpn/OpenVpnService.java') diff --git a/src/de/blinkt/openvpn/OpenVpnService.java b/src/de/blinkt/openvpn/OpenVpnService.java index 8da49ba..442fd94 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))); + } } -- cgit v1.2.3