cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jaya...@apache.org
Subject [2/2] git commit: updated refs/heads/master to f45c9f9
Date Tue, 01 Jul 2014 09:48:18 GMT
CLOUDSTACK-7027: Removing left over static nat rule


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

Branch: refs/heads/master
Commit: f45c9f9d2f4185a5e8fb631065700d6dc5987ae4
Parents: 2f1b40d
Author: Jayapal <jayapal@apache.org>
Authored: Tue Jul 1 12:28:35 2014 +0530
Committer: Jayapal <jayapal@apache.org>
Committed: Tue Jul 1 15:16:35 2014 +0530

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


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/f45c9f9d/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 885de83..1068a2f 100755
--- a/server/src/com/cloud/network/router/VirtualNetworkApplianceManagerImpl.java
+++ b/server/src/com/cloud/network/router/VirtualNetworkApplianceManagerImpl.java
@@ -3389,15 +3389,28 @@ VirtualMachineGuru, Listener, Configurable, StateListener<State,
VirtualMachine.
             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