cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From anthon...@apache.org
Subject git commit: updated refs/heads/4.2 to 9cc1bc4
Date Tue, 13 Aug 2013 22:12:44 GMT
Updated Branches:
  refs/heads/4.2 7f6312806 -> 9cc1bc40d


CLOUDSTACK-4282
    allow overlapped subnet with different VLANs in shared network


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

Branch: refs/heads/4.2
Commit: 9cc1bc40d25d86148e40c1340558196603c34d70
Parents: 7f63128
Author: Anthony Xu <anthony.xu@citrix.com>
Authored: Tue Aug 13 15:11:14 2013 -0700
Committer: Anthony Xu <anthony.xu@citrix.com>
Committed: Tue Aug 13 15:12:14 2013 -0700

----------------------------------------------------------------------
 .../configuration/ConfigurationManagerImpl.java | 24 ++++++++++++++++----
 1 file changed, 20 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/9cc1bc40/server/src/com/cloud/configuration/ConfigurationManagerImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/configuration/ConfigurationManagerImpl.java b/server/src/com/cloud/configuration/ConfigurationManagerImpl.java
index f5e417e..5261462 100755
--- a/server/src/com/cloud/configuration/ConfigurationManagerImpl.java
+++ b/server/src/com/cloud/configuration/ConfigurationManagerImpl.java
@@ -3112,12 +3112,28 @@ public class ConfigurationManagerImpl extends ManagerBase implements
Configurati
                 if( !NetUtils.isNetworksOverlap(newCidr,  otherCidr)) {
                     continue;
                 }
-                // from here, subnet overlaps
+                // from here, subnet overlaps               
                 if ( !vlanId.equals(vlan.getVlanTag()) ) {
-                    throw new InvalidParameterValueException("The IP range with tag: " +
vlan.getVlanTag()
-                            + " in zone " + zone.getName()
-                            + " has overlapped with the subnet. Please specify a different
gateway/netmask.");
+                    boolean overlapped = false;
+                    if( network.getTrafficType() == TrafficType.Public ) {
+                        overlapped = true;
+                    } else {
+                        Long nwId = vlan.getNetworkId();
+                        if ( nwId != null ) {
+                            Network nw = _networkModel.getNetwork(nwId);
+                            if ( nw != null && nw.getTrafficType() == TrafficType.Public
) {
+                                overlapped = true;
+                            }
+                        }
+                        
+                    }
+                    if ( overlapped ) {
+                        throw new InvalidParameterValueException("The IP range with tag:
" + vlan.getVlanTag()
+                                + " in zone " + zone.getName()
+                                + " has overlapped with the subnet. Please specify a different
gateway/netmask.");
+                    }
                 }
+
                 if ( vlan.getNetworkId() != networkId) {
                     throw new InvalidParameterValueException("This subnet is overlapped with
subnet in other network " + vlan.getNetworkId()
                             + " in zone " + zone.getName()


Mime
View raw message