incubator-cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From alena1...@apache.org
Subject git commit: VPC: CS-15805 - guest cidr should be RFC1918 complient
Date Tue, 14 Aug 2012 00:19:19 GMT
Updated Branches:
  refs/heads/master f0baaf6a2 -> b3760350f


VPC: CS-15805 - guest cidr should be RFC1918 complient


Project: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/commit/b3760350
Tree: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/tree/b3760350
Diff: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/diff/b3760350

Branch: refs/heads/master
Commit: b3760350fe73c4001aa5a0d5bb97ec3717a3db2b
Parents: f0baaf6
Author: Alena Prokharchyk <alena.prokharchyk@citrix.com>
Authored: Mon Aug 13 16:58:45 2012 -0700
Committer: Alena Prokharchyk <alena.prokharchyk@citrix.com>
Committed: Mon Aug 13 17:17:06 2012 -0700

----------------------------------------------------------------------
 .../src/com/cloud/network/vpc/VpcManagerImpl.java  |   15 +++++----------
 1 files changed, 5 insertions(+), 10 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/b3760350/server/src/com/cloud/network/vpc/VpcManagerImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/network/vpc/VpcManagerImpl.java b/server/src/com/cloud/network/vpc/VpcManagerImpl.java
index 3d6f930..492e6a8 100644
--- a/server/src/com/cloud/network/vpc/VpcManagerImpl.java
+++ b/server/src/com/cloud/network/vpc/VpcManagerImpl.java
@@ -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, 


Mime
View raw message