incubator-cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ke4...@apache.org
Subject [29/50] [abbrv] git commit: CS-15083: fixed source nat ip assoc for the case when account owns more than 1 guest network, and 1+ public account specific ranges
Date Sun, 27 May 2012 22:35:41 GMT
CS-15083: fixed source nat ip assoc for the case when account owns more than 1 guest network,
and 1+ public account specific ranges


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

Branch: refs/heads/3.0.x
Commit: 269d4dac8369c8553b03f8d18bc92fed239c6732
Parents: 40c1cdd
Author: Alena Prokharchyk <alena.prokharchyk@citrix.com>
Authored: Thu May 24 13:40:25 2012 -0700
Committer: Alena Prokharchyk <alena.prokharchyk@citrix.com>
Committed: Thu May 24 13:41:16 2012 -0700

----------------------------------------------------------------------
 .../src/com/cloud/network/NetworkManagerImpl.java  |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/269d4dac/server/src/com/cloud/network/NetworkManagerImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/network/NetworkManagerImpl.java b/server/src/com/cloud/network/NetworkManagerImpl.java
index 7c9b51b..57d58ce 100755
--- a/server/src/com/cloud/network/NetworkManagerImpl.java
+++ b/server/src/com/cloud/network/NetworkManagerImpl.java
@@ -519,7 +519,11 @@ public class NetworkManagerImpl implements NetworkManager, NetworkService,
Manag
                 Long vlanId = null;
                 List<AccountVlanMapVO> maps = _accountVlanMapDao.listAccountVlanMapsByAccount(ownerId);
                 if (maps != null && !maps.isEmpty()) {
-                    vlanId = maps.get(0).getVlanDbId();
+                    //check if the ips from this vlan are associated with this network
+                    List<IPAddressVO> ips = _ipAddressDao.listByVlanId(maps.get(0).getVlanDbId());
+                    if (ips != null && !ips.isEmpty() && ips.get(0).getAssociatedWithNetworkId()
== network.getId()) {
+                        vlanId = maps.get(0).getVlanDbId();
+                    }
                 }
 
                 ip = fetchNewPublicIp(dcId, null, vlanId, owner, VlanType.VirtualNetwork,
network.getId(), true, false, null, false);


Mime
View raw message