cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From d...@apache.org
Subject [2/2] git commit: updated refs/heads/4.4 to 0902234
Date Tue, 01 Jul 2014 12:36:44 GMT
CLOUDSTACK-7027: Removing left over static nat rule

(cherry picked from commit a69c1ee31d233d4a6f77d68fd70b9cfe3c85f89b)


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

Branch: refs/heads/4.4
Commit: 09022344eec00330dd5d7f65778d4208ee893de4
Parents: d5a9245
Author: Jayapal <jayapal@apache.org>
Authored: Tue Jul 1 12:28:35 2014 +0530
Committer: Daan Hoogland <daan@onecht.net>
Committed: Tue Jul 1 14:36:33 2014 +0200

----------------------------------------------------------------------
 .../router/VirtualNetworkApplianceManagerImpl.java     | 13 +++++++++++++
 1 file changed, 13 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/09022344/server/src/com/cloud/network/router/VirtualNetworkApplianceManagerImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/network/router/VirtualNetworkApplianceManagerImpl.java b/server/src/com/cloud/network/router/VirtualNetworkApplianceManagerImpl.java
index bf0a6cc..2363841 100755
--- a/server/src/com/cloud/network/router/VirtualNetworkApplianceManagerImpl.java
+++ b/server/src/com/cloud/network/router/VirtualNetworkApplianceManagerImpl.java
@@ -3391,15 +3391,28 @@ public class VirtualNetworkApplianceManagerImpl extends ManagerBase
implements V
             final IpAddressTO[] ipsToSend = new IpAddressTO[ipAddrList.size()];
             int i = 0;
             boolean firstIP = true;
+            boolean isSourceNatNw = false;
 
             for (final PublicIpAddress ipAddr : ipAddrList) {
 
                 final boolean add = (ipAddr.getState() == IpAddress.State.Releasing ? false
: true);
                 boolean sourceNat = ipAddr.isSourceNat();
+
+                //set the isSourceNatNw from the first ip of ipAddrList
+                //For non source network ips the isSourceNatNw is always false
+                if (sourceNat) {
+                    isSourceNatNw = ipAddr.isSourceNat();
+                }
+
                 /* enable sourceNAT for the first ip of the public interface */
                 if (firstIP) {
                     sourceNat = true;
                 }
+
+                // setting sourceNat=true to make sure the snat rule of the ip is deleted
+                if (!isSourceNatNw && !add ) {
+                    sourceNat = true;
+                }
                 final String vlanId = ipAddr.getVlanTag();
                 final String vlanGateway = ipAddr.getGateway();
                 final String vlanNetmask = ipAddr.getNetmask();


Mime
View raw message