cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jaya...@apache.org
Subject git commit: updated refs/heads/master to 6164077
Date Tue, 06 Aug 2013 11:03:50 GMT
Updated Branches:
  refs/heads/master 5cb090ed4 -> 6164077ee


CLOUDSTACK-4084 Fixed the static nat vm ip address in public ip address table in external
network gc

    In external network after network GC the network n/w cidr changes.
    In this case the static nat enable vm ip also chagnes. So updated the new
    vm ip address in user_ip_address table.


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

Branch: refs/heads/master
Commit: 6164077ee88786bc80b895f889b45c17fdf7ae2e
Parents: 5cb090e
Author: Jayapal <jayapal@apache.org>
Authored: Tue Aug 6 16:25:24 2013 +0530
Committer: Jayapal <jayapal@apache.org>
Committed: Tue Aug 6 16:25:51 2013 +0530

----------------------------------------------------------------------
 .../network/guru/ExternalGuestNetworkGuru.java      | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/6164077e/server/src/com/cloud/network/guru/ExternalGuestNetworkGuru.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/network/guru/ExternalGuestNetworkGuru.java b/server/src/com/cloud/network/guru/ExternalGuestNetworkGuru.java
index 9355d77..fdab0c6 100644
--- a/server/src/com/cloud/network/guru/ExternalGuestNetworkGuru.java
+++ b/server/src/com/cloud/network/guru/ExternalGuestNetworkGuru.java
@@ -23,6 +23,8 @@ import javax.inject.Inject;
 
 import com.cloud.event.ActionEventUtils;
 
+import com.cloud.network.dao.IPAddressDao;
+import com.cloud.network.dao.IPAddressVO;
 import org.apache.log4j.Logger;
 
 import org.apache.cloudstack.context.CallContext;
@@ -72,6 +74,9 @@ public class ExternalGuestNetworkGuru extends GuestNetworkGuru {
     DataCenterDao _zoneDao;
     @Inject
     PortForwardingRulesDao _pfRulesDao;
+    @Inject
+    IPAddressDao _ipAddressDao;
+
 
     public ExternalGuestNetworkGuru() {
         super();
@@ -193,6 +198,17 @@ public class ExternalGuestNetworkGuru extends GuestNetworkGuru {
         		_pfRulesDao.update(pfRule.getId(), pfRule);
         	}
         }
+        // Mask the destination address of all static nat rules in this network with the
new guest VLAN offset
+        // Here the private ip of the nic get updated. When secondary ip are present the
gc will not triggered
+        List <IPAddressVO> ipAddrsOfNw = _ipAddressDao.listStaticNatPublicIps(config.getId());
+        for (IPAddressVO ip: ipAddrsOfNw) {
+            if (ip.getVmIp() != null) {
+                long ipMask = getIpMask(ip.getVmIp(), cidrSize);
+                String maskedVmIp =  NetUtils.long2Ip(newCidrAddress | ipMask);
+                ip.setVmIp(maskedVmIp);
+                _ipAddressDao.update(ip.getId(), ip);
+            }
+        }
 
         return implemented;
     }


Mime
View raw message