Fixed the conditon which checks for the provider's capabilty and reapply ipaliases on virtual router restart.

Signed-off-by: Abhinandan Prateek <aprateek@apache.org>
This commit is contained in:
Bharat Kumar 2013-07-17 17:07:11 +05:30 committed by Abhinandan Prateek
parent d06a5bc5f0
commit a8387568f3
2 changed files with 2 additions and 2 deletions

View File

@ -2013,7 +2013,7 @@ public class NetworkManagerImpl extends ManagerBase implements NetworkManager, L
DhcpServiceProvider sp = (DhcpServiceProvider) element;
Map <Capability, String> dhcpCapabilities = element.getCapabilities().get(Service.Dhcp);
String supportsMultipleSubnets = dhcpCapabilities.get(Capability.DhcpAccrossMultipleSubnets);
if ((supportsMultipleSubnets != null || Boolean.valueOf(supportsMultipleSubnets)) && profile.getIp6Address() == null) {
if ((supportsMultipleSubnets != null && Boolean.valueOf(supportsMultipleSubnets)) && profile.getIp6Address() == null) {
if (!sp.configDhcpSupportForSubnet(network, profile, vmProfile, dest, context)) {
return false;
}

View File

@ -2483,7 +2483,7 @@ public class VirtualNetworkApplianceManagerImpl extends ManagerBase implements V
if (_networkModel.isProviderSupportServiceInNetwork(guestNetworkId, Service.Dhcp, provider)) {
Map<Network.Capability, String> dhcpCapabilities = _networkSvc.getNetworkOfferingServiceCapabilities(_networkOfferingDao.findById(_networkDao.findById(guestNetworkId).getNetworkOfferingId()), Service.Dhcp);
String supportsMultipleSubnets = dhcpCapabilities.get(Network.Capability.DhcpAccrossMultipleSubnets);
if (supportsMultipleSubnets == null || !Boolean.valueOf(supportsMultipleSubnets)) {
if (supportsMultipleSubnets != null && Boolean.valueOf(supportsMultipleSubnets)) {
List<NicIpAliasVO> revokedIpAliasVOs = _nicIpAliasDao.listByNetworkIdAndState(guestNetworkId, NicIpAlias.state.revoked);
s_logger.debug("Found" + revokedIpAliasVOs.size() + "ip Aliases to revoke on the router as a part of dhcp configuration");
removeRevokedIpAliasFromDb(revokedIpAliasVOs);