mirror of https://github.com/apache/cloudstack.git
CS-15083: fixed source nat ip assoc for the case when account owns more than 1 guest network, and 1+ public account specific ranges
This commit is contained in:
parent
45311fefc1
commit
f6efcd39a3
|
|
@ -513,7 +513,11 @@ public class NetworkManagerImpl implements NetworkManager, NetworkService, Manag
|
|||
Long vlanId = null;
|
||||
List<AccountVlanMapVO> maps = _accountVlanMapDao.listAccountVlanMapsByAccount(ownerId);
|
||||
if (maps != null && !maps.isEmpty()) {
|
||||
vlanId = maps.get(0).getVlanDbId();
|
||||
//check if the ips from this vlan are associated with this network
|
||||
List<IPAddressVO> ips = _ipAddressDao.listByVlanId(maps.get(0).getVlanDbId());
|
||||
if (ips != null && !ips.isEmpty() && ips.get(0).getAssociatedWithNetworkId() == network.getId()) {
|
||||
vlanId = maps.get(0).getVlanDbId();
|
||||
}
|
||||
}
|
||||
|
||||
ip = fetchNewPublicIp(dcId, null, vlanId, owner, VlanType.VirtualNetwork, network.getId(), true, false, null, false);
|
||||
|
|
|
|||
Loading…
Reference in New Issue