diff options
author | Arne Schwabe <arne@blinkt.de> | 2012-06-27 23:00:32 +0200 |
---|---|---|
committer | Arne Schwabe <arne@blinkt.de> | 2012-06-27 23:00:32 +0200 |
commit | cfffc9694c4b44ed26710fd85d1a361d13b0815e (patch) | |
tree | 4858213702fac5bb0038fe3065d01472234a798d /src/de/blinkt/openvpn/VpnProfile.java | |
parent | e27446ef9f1c8b0399e1bb6edfe8df1c77e7cd9e (diff) |
log phone version
support more than 100 routes
Diffstat (limited to 'src/de/blinkt/openvpn/VpnProfile.java')
-rw-r--r-- | src/de/blinkt/openvpn/VpnProfile.java | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/src/de/blinkt/openvpn/VpnProfile.java b/src/de/blinkt/openvpn/VpnProfile.java index d679cd00..dd729a06 100644 --- a/src/de/blinkt/openvpn/VpnProfile.java +++ b/src/de/blinkt/openvpn/VpnProfile.java @@ -261,11 +261,14 @@ public class VpnProfile implements Serializable{ if(mUsePull && mRoutenopull) cfg += "route-nopull\n"; + String routes = ""; + int numroutes=0; if(mUseDefaultRoute) - cfg += "route 0.0.0.0 0.0.0.0\n"; + routes += "route 0.0.0.0 0.0.0.0\n"; else for(String route:getCustomRoutes()) { - cfg += "route " + route + "\n"; + routes += "route " + route + "\n"; + numroutes++; } @@ -273,9 +276,18 @@ public class VpnProfile implements Serializable{ cfg += "route-ipv6 ::/0\n"; else for(String route:getCustomRoutesv6()) { - cfg += "route-ipv6 " + route + "\n"; + routes += "route-ipv6 " + route + "\n"; + numroutes++; } + // Round number to next 100 + if(numroutes> 90) { + numroutes = ((numroutes / 100)+1) * 100; + cfg+="# Alot of routes are set, increase max-routes\n"; + cfg+="max-routes " + numroutes + "\n"; + } + cfg+=routes; + if(mOverrideDNS || !mUsePull) { if(nonNull(mDNS1)) cfg+="dhcp-option DNS " + mDNS1 + "\n"; |