cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From d...@apache.org
Subject git commit: updated refs/heads/4.4 to 213bdbd
Date Fri, 12 Sep 2014 10:07:20 GMT
Repository: cloudstack
Updated Branches:
  refs/heads/4.4 aa81823ce -> 213bdbde3


CLOUDSTACK-6223. removeNicFromVirtualMachine fails if another instance in another domain has
a nic with the same ip and a forwarding rule configured on it

Signed-off-by: Daan Hoogland <daan@onecht.net>
(cherry picked from commit e9af5f44ae080da3f191cba57b55747801c3100e)


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

Branch: refs/heads/4.4
Commit: 213bdbde35e273b2c40d421071e46f2af6de729c
Parents: aa81823
Author: Upendra Moturi <upendra.moturi@sungard.com>
Authored: Tue Apr 1 18:26:44 2014 +0530
Committer: Daan Hoogland <daan@onecht.net>
Committed: Fri Sep 12 12:07:04 2014 +0200

----------------------------------------------------------------------
 .../com/cloud/network/rules/dao/PortForwardingRulesDao.java  | 2 ++
 .../cloud/network/rules/dao/PortForwardingRulesDaoImpl.java  | 8 ++++++++
 server/src/com/cloud/network/rules/RulesManagerImpl.java     | 2 +-
 3 files changed, 11 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/213bdbde/engine/schema/src/com/cloud/network/rules/dao/PortForwardingRulesDao.java
----------------------------------------------------------------------
diff --git a/engine/schema/src/com/cloud/network/rules/dao/PortForwardingRulesDao.java b/engine/schema/src/com/cloud/network/rules/dao/PortForwardingRulesDao.java
index 4694cb9..5b0e748 100644
--- a/engine/schema/src/com/cloud/network/rules/dao/PortForwardingRulesDao.java
+++ b/engine/schema/src/com/cloud/network/rules/dao/PortForwardingRulesDao.java
@@ -44,5 +44,7 @@ public interface PortForwardingRulesDao extends GenericDao<PortForwardingRuleVO,
 
     List<PortForwardingRuleVO> listByDestIpAddr(String ip4Address);
 
+    List<PortForwardingRuleVO> listByVmidAndDestIpAddr(String ip4Address,long vmid);
+
     PortForwardingRuleVO findByIdAndIp(long id, String secondaryIp);
 }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/213bdbde/engine/schema/src/com/cloud/network/rules/dao/PortForwardingRulesDaoImpl.java
----------------------------------------------------------------------
diff --git a/engine/schema/src/com/cloud/network/rules/dao/PortForwardingRulesDaoImpl.java
b/engine/schema/src/com/cloud/network/rules/dao/PortForwardingRulesDaoImpl.java
index 45c0aeb..6bc401b 100644
--- a/engine/schema/src/com/cloud/network/rules/dao/PortForwardingRulesDaoImpl.java
+++ b/engine/schema/src/com/cloud/network/rules/dao/PortForwardingRulesDaoImpl.java
@@ -158,6 +158,14 @@ public class PortForwardingRulesDaoImpl extends GenericDaoBase<PortForwardingRul
     }
 
     @Override
+    public List<PortForwardingRuleVO> listByVmidAndDestIpAddr(String ip4Address,long
vmid) {
+        SearchCriteria<PortForwardingRuleVO> sc = AllFieldsSearch.create();
+        sc.setParameters("dstIp", ip4Address);
+        sc.setParameters("vmId", vmid);
+        return listBy(sc);
+    }
+
+    @Override
     public PortForwardingRuleVO findByIdAndIp(long id, String secondaryIp) {
         SearchCriteria<PortForwardingRuleVO> sc = AllFieldsSearch.create();
         sc.setParameters("id", id);

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/213bdbde/server/src/com/cloud/network/rules/RulesManagerImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/network/rules/RulesManagerImpl.java b/server/src/com/cloud/network/rules/RulesManagerImpl.java
index eea1262..59025f2 100755
--- a/server/src/com/cloud/network/rules/RulesManagerImpl.java
+++ b/server/src/com/cloud/network/rules/RulesManagerImpl.java
@@ -1465,7 +1465,7 @@ public class RulesManagerImpl extends ManagerBase implements RulesManager,
Rules
     public List<FirewallRuleVO> listAssociatedRulesForGuestNic(Nic nic) {
         List<FirewallRuleVO> result = new ArrayList<FirewallRuleVO>();
         // add PF rules
-        result.addAll(_portForwardingDao.listByDestIpAddr(nic.getIp4Address()));
+        result.addAll(_portForwardingDao.listByVmidAndDestIpAddr(nic.getIp4Address(),nic.getInstanceId()));
         // add static NAT rules
         List<FirewallRuleVO> staticNatRules = _firewallDao.listStaticNatByVmId(nic.getInstanceId());
         for (FirewallRuleVO rule : staticNatRules) {


Mime
View raw message