diff --git a/server/src/com/cloud/network/vpc/VpcManagerImpl.java b/server/src/com/cloud/network/vpc/VpcManagerImpl.java index 492e6a81903..e06c843f8d6 100644 --- a/server/src/com/cloud/network/vpc/VpcManagerImpl.java +++ b/server/src/com/cloud/network/vpc/VpcManagerImpl.java @@ -1054,8 +1054,8 @@ public class VpcManagerImpl implements VpcManager, Manager{ for (Network ntwk : ntwks) { assert (cidr != null) : "Why the network cidr is null when it belongs to vpc?"; - if (NetUtils.isNetworkAWithinNetworkB(ntwk.getCidr(), vpc.getCidr()) - || NetUtils.isNetworkAWithinNetworkB(vpc.getCidr(), ntwk.getCidr())) { + if (NetUtils.isNetworkAWithinNetworkB(ntwk.getCidr(), cidr) + || NetUtils.isNetworkAWithinNetworkB(cidr, ntwk.getCidr())) { throw new InvalidParameterValueException("Network cidr " + cidr + " crosses other network cidr " + ntwk + " belonging to the same vpc " + vpc); }