mirror of https://github.com/apache/cloudstack.git
VPC: CS-15805 - guest cidr should be RFC1918 complient
This commit is contained in:
parent
f0baaf6a22
commit
b3760350fe
|
|
@ -583,6 +583,11 @@ public class VpcManagerImpl implements VpcManager, Manager{
|
|||
if (!NetUtils.isValidCIDR(cidr)) {
|
||||
throw new InvalidParameterValueException("Invalid CIDR specified " + cidr);
|
||||
}
|
||||
|
||||
//cidr has to be RFC 1918 complient
|
||||
if (!NetUtils.validateGuestCidr(cidr)) {
|
||||
throw new InvalidParameterValueException("Guest Cidr " + cidr + " is not RFC1918 compliant");
|
||||
}
|
||||
|
||||
// validate network domain
|
||||
if (!NetUtils.verifyDomainName(networkDomain)) {
|
||||
|
|
@ -593,16 +598,6 @@ public class VpcManagerImpl implements VpcManager, Manager{
|
|||
+ "and the hyphen ('-'); can't start or end with \"-\"");
|
||||
}
|
||||
|
||||
|
||||
// //don't allow overlapping CIDRS for the VPCs of the same account
|
||||
// List<? extends Vpc> vpcs = getVpcsForAccount(vpcOwner.getId());
|
||||
// for (Vpc vpc : vpcs) {
|
||||
// if (NetUtils.isNetworksOverlap(cidr, vpc.getCidr())) {
|
||||
// throw new InvalidParameterValueException("Account already has vpc with cidr " + vpc.getCidr() +
|
||||
// " that overlaps the cidr specified: " + cidr, null);
|
||||
// }
|
||||
// }
|
||||
|
||||
Transaction txn = Transaction.currentTxn();
|
||||
txn.start();
|
||||
VpcVO vpc = new VpcVO (zoneId, vpcName, displayText, vpcOwner.getId(), vpcOwner.getDomainId(), vpcOffId, cidr,
|
||||
|
|
|
|||
Loading…
Reference in New Issue