diff options
-rw-r--r-- | main/src/main/java/de/blinkt/openvpn/core/ConfigParser.java | 4 | ||||
-rw-r--r-- | main/src/main/java/de/blinkt/openvpn/core/NetworkSpace.java | 6 |
2 files changed, 8 insertions, 2 deletions
diff --git a/main/src/main/java/de/blinkt/openvpn/core/ConfigParser.java b/main/src/main/java/de/blinkt/openvpn/core/ConfigParser.java index cd57b397..378b6b92 100644 --- a/main/src/main/java/de/blinkt/openvpn/core/ConfigParser.java +++ b/main/src/main/java/de/blinkt/openvpn/core/ConfigParser.java @@ -361,6 +361,10 @@ public class ConfigParser { } catch (ArrayIndexOutOfBoundsException aioob) { throw new ConfigParseError("Could not parse netmask of route " + netmask); } catch (NumberFormatException ne) { + + + + throw new ConfigParseError("Could not parse netmask of route " + netmask); } diff --git a/main/src/main/java/de/blinkt/openvpn/core/NetworkSpace.java b/main/src/main/java/de/blinkt/openvpn/core/NetworkSpace.java index 6e27c0cb..044d99ff 100644 --- a/main/src/main/java/de/blinkt/openvpn/core/NetworkSpace.java +++ b/main/src/main/java/de/blinkt/openvpn/core/NetworkSpace.java @@ -200,13 +200,15 @@ public class NetworkSpace { ipAddress[] newNets = nextNet.split(); // First add the second half to keep the order in networks - networks.add(newNets[1]); + if (!networks.contains(newNets[1])) + networks.add(newNets[1]); if (newNets[0].getLastAddress().equals(currentNet.getLastAddress())) { assert (newNets[0].networkMask == currentNet.networkMask); // Don't add the lower half that would conflict with currentNet } else { - networks.add(newNets[0]); + if (!networks.contains(newNets[0])) + networks.add(newNets[0]); } // Keep currentNet as is } |