diff options
author | Parménides GV <parmegv@sdf.org> | 2015-01-31 01:21:46 +0100 |
---|---|---|
committer | Parménides GV <parmegv@sdf.org> | 2015-01-31 01:21:46 +0100 |
commit | e495feae1bde6c6d7db0db5bf4959f501b8c1375 (patch) | |
tree | 90c4af22d047b7297a66a9e623c86c5af63b12f6 /app/src/main/java/de/blinkt/openvpn/core/NetworkSpace.java | |
parent | 618792ca47208818b892257da7d55809ed8ae20f (diff) | |
parent | 29fd5bc150155505a9fe0ffa4f1d0ac81db78724 (diff) |
Merge branch 'develop' into release-0.9.2
Diffstat (limited to 'app/src/main/java/de/blinkt/openvpn/core/NetworkSpace.java')
-rw-r--r-- | app/src/main/java/de/blinkt/openvpn/core/NetworkSpace.java | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/app/src/main/java/de/blinkt/openvpn/core/NetworkSpace.java b/app/src/main/java/de/blinkt/openvpn/core/NetworkSpace.java index 26354689..c86f9e44 100644 --- a/app/src/main/java/de/blinkt/openvpn/core/NetworkSpace.java +++ b/app/src/main/java/de/blinkt/openvpn/core/NetworkSpace.java @@ -172,8 +172,16 @@ public class NetworkSpace { } public boolean containsNet(ipAddress network) { - return getFirstAddress().compareTo(network.getFirstAddress()) != 1 && - getLastAddress().compareTo(network.getLastAddress()) != -1; + // this.first >= net.first && this.last <= net.last + BigInteger ourFirst = getFirstAddress(); + BigInteger ourLast = getLastAddress(); + BigInteger netFirst = network.getFirstAddress(); + BigInteger netLast = network.getLastAddress(); + + boolean a = ourFirst.compareTo(netFirst) != 1; + boolean b = ourLast.compareTo(netLast) != -1; + return a && b; + } } @@ -320,6 +328,7 @@ public class NetworkSpace { boolean skipIp=false; // If there is any smaller net that is excluded we may not add the positive route back + for (ipAddress calculatedIp: ipsSorted) { if(!calculatedIp.included && origIp.containsNet(calculatedIp)) { skipIp=true; |