mirror of https://github.com/apache/cloudstack.git
CLOUDSTACK-7027: Removing left over static nat rule
(cherry picked from commit a69c1ee31d)
This commit is contained in:
parent
d5a92454fd
commit
09022344ee
|
|
@ -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();
|
||||
|
|
|
|||
Loading…
Reference in New Issue