mirror of
https://github.com/apache/cloudstack.git
synced 2025-11-02 11:52:28 +01:00
move back to original contract of isNetworksOverlap()
This commit is contained in:
parent
b4c5cd4e22
commit
4b7f87b9c8
@ -1170,14 +1170,15 @@ public class NetUtils {
|
||||
}
|
||||
|
||||
public static boolean isNetworksOverlap(final String cidrA, final String cidrB) {
|
||||
if (!areCidrsNotEmpty(cidrA, cidrB)) {
|
||||
return false;
|
||||
try {
|
||||
Long[] cidrALong = cidrToLong(cidrA);
|
||||
Long[] cidrBLong = cidrToLong(cidrB);
|
||||
final long shift = MAX_CIDR - (cidrALong[1] > cidrBLong[1] ? cidrBLong[1] : cidrALong[1]);
|
||||
return cidrALong[0] >> shift == cidrBLong[0] >> shift;
|
||||
} catch (CloudRuntimeException e) {
|
||||
s_logger.error(e.getLocalizedMessage(),e);
|
||||
}
|
||||
Long[] cidrALong = cidrToLong(cidrA);
|
||||
Long[] cidrBLong = cidrToLong(cidrB);
|
||||
|
||||
final long shift = MAX_CIDR - (cidrALong[1] > cidrBLong[1] ? cidrBLong[1] : cidrALong[1]);
|
||||
return cidrALong[0] >> shift == cidrBLong[0] >> shift;
|
||||
return false;
|
||||
}
|
||||
|
||||
public static boolean isValidS2SVpnPolicy(final String policys) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user