From 0c3f0cae9bcfc862052e9ccc137a63f9587002a2 Mon Sep 17 00:00:00 2001 From: Arne Schwabe Date: Mon, 17 Feb 2014 19:50:14 +0100 Subject: Add the dynamic max routes patch --- main/src/main/java/de/blinkt/openvpn/VpnProfile.java | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) (limited to 'main/src') diff --git a/main/src/main/java/de/blinkt/openvpn/VpnProfile.java b/main/src/main/java/de/blinkt/openvpn/VpnProfile.java index 1ec34b51..d7a0703b 100644 --- a/main/src/main/java/de/blinkt/openvpn/VpnProfile.java +++ b/main/src/main/java/de/blinkt/openvpn/VpnProfile.java @@ -322,14 +322,13 @@ public class VpnProfile implements Serializable { cfg += "route-nopull\n"; String routes = ""; - int numroutes = 0; + if (mUseDefaultRoute) routes += "route 0.0.0.0 0.0.0.0 vpn_gateway\n"; else { for (String route : getCustomRoutes(mCustomRoutes)) { routes += "route " + route + " vpn_gateway\n"; - numroutes++; } for (String route: getCustomRoutes(mExcludedRoutes)) { @@ -348,15 +347,8 @@ public class VpnProfile implements Serializable { else for (String route : getCustomRoutesv6(mCustomRoutesv6)) { routes += "route-ipv6 " + route + "\n"; - numroutes++; } - // Round number to next 100 - if (numroutes > 90) { - numroutes = ((numroutes / 100) + 1) * 100; - cfg += "# A lot of routes are set, increase max-routes\n"; - cfg += "max-routes " + numroutes + "\n"; - } cfg += routes; if (mOverrideDNS || !mUsePull) { -- cgit v1.2.3