CLOUDSTACK-1771: Fix VR IP change when restartnetwork with cleanup=true in basic zone

In basic network, the correct network id associate with IP is source network id
rather than network id.
This commit is contained in:
Sheng Yang 2014-10-27 16:46:01 -07:00
parent 4f43839dae
commit 307a35a618
1 changed files with 1 additions and 1 deletions

View File

@ -2165,7 +2165,7 @@ public class NetworkModelImpl extends ManagerBase implements NetworkModel {
List<? extends Vlan> vlans = _vlanDao.listVlansForPod(podId);
for (Vlan vlan : vlans) {
if (nic.getIp4Address() != null) {
IpAddress ip = _ipAddressDao.findByIpAndNetworkId(network.getId(), nic.getIp4Address());
IpAddress ip = _ipAddressDao.findByIpAndSourceNetworkId(network.getId(), nic.getIp4Address());
if (ip != null && ip.getVlanId() == vlan.getId()) {
return nic;
}