bug 12705: Don't set first ip if it's not source NAT

It would happen with first ip of nics other than first public nic.

status 12705: resolved fixed
This commit is contained in:
Sheng Yang 2011-12-30 13:33:23 -08:00
parent d56d1f699d
commit 1bc44a578d
2 changed files with 6 additions and 0 deletions

View File

@ -1583,6 +1583,8 @@ public abstract class CitrixResourceBase implements ServerResource, HypervisorRe
if (add && correctVif == null) {
addVif = true;
} else if (!add && firstIP) {
/* FIXME: This is incorrect. Because you can only tell if it's the first IP in this bundle of ip address which send to the router,
* but don't know if it's the only IP left in the router - because we didn't send all the related vlan's IPs to the router now. */
removeVif = true;
}

View File

@ -2443,6 +2443,10 @@ public class VirtualNetworkApplianceManagerImpl implements VirtualNetworkApplian
IpAddressTO[] ipsToSend = new IpAddressTO[ipAddrList.size()];
int i = 0;
boolean firstIP = true;
/* If the first IP is not source NAT, then don't treat it as first IP. It would happen if it's the first IP for public nic other than first one */
if (!ipAddrList.get(0).isSourceNat()) {
firstIP = false;
}
for (final PublicIpAddress ipAddr : ipAddrList) {
boolean add = (ipAddr.getState() == IpAddress.State.Releasing ? false : true);