You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by mu...@apache.org on 2013/12/31 06:40:14 UTC

git commit: updated refs/heads/master to 14241ce

Updated Branches:
  refs/heads/master c1101eb69 -> 14241ce23


CLOUDSTACK-5667: Shared Network - fails to launch router due to "
Multiple generic soure NAT IPs provided for network"

'getExistingSourceNatInNetwork' method was retruning source nat ip for
a particular account, resulting in multiple source nat ip's to be
assigned to a shared network on network implemen. Fix ensures that
account id is not considered for shared network implement.


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

Branch: refs/heads/master
Commit: 14241ce23301cd9ef9deadfb785f70b2a4f937fb
Parents: c1101eb
Author: Murali Reddy <mu...@gmail.com>
Authored: Tue Dec 31 11:02:54 2013 +0530
Committer: Murali Reddy <mu...@gmail.com>
Committed: Tue Dec 31 11:09:57 2013 +0530

----------------------------------------------------------------------
 server/src/com/cloud/network/IpAddressManagerImpl.java | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/14241ce2/server/src/com/cloud/network/IpAddressManagerImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/network/IpAddressManagerImpl.java b/server/src/com/cloud/network/IpAddressManagerImpl.java
index 26cf15a..0058c6e 100644
--- a/server/src/com/cloud/network/IpAddressManagerImpl.java
+++ b/server/src/com/cloud/network/IpAddressManagerImpl.java
@@ -1105,8 +1105,14 @@ public class IpAddressManagerImpl extends ManagerBase implements IpAddressManage
     }
 
     protected IPAddressVO getExistingSourceNatInNetwork(long ownerId, Long networkId) {
-
-        List<? extends IpAddress> addrs = _networkModel.listPublicIpsAssignedToGuestNtwk(ownerId, networkId, true);
+        List<? extends IpAddress> addrs;
+        Network guestNetwork = _networksDao.findById(networkId);
+        if (guestNetwork.getGuestType() == GuestType.Shared) {
+            // ignore the account id for the shared network
+            addrs = _networkModel.listPublicIpsAssignedToGuestNtwk(networkId, true);
+        } else {
+            addrs = _networkModel.listPublicIpsAssignedToGuestNtwk(ownerId, networkId, true);
+        }
 
         IPAddressVO sourceNatIp = null;
         if (addrs.isEmpty()) {