Don't need to handle dhcp entry differently for different guest OS

This commit is contained in:
Anthony Xu 2013-05-29 16:51:42 -07:00
parent 271cf92ab7
commit 51930405d9
1 changed files with 0 additions and 13 deletions

View File

@ -3370,20 +3370,7 @@ public class VirtualNetworkApplianceManagerImpl extends ManagerBase implements V
DataCenterVO dcVo = _dcDao.findById(router.getDataCenterId());
Nic defaultNic = findGatewayIp(vm.getId());
String gatewayIp = defaultNic.getGateway();
boolean needGateway = true;
if (gatewayIp != null && !gatewayIp.equals(nic.getGateway())) {
needGateway = false;
GuestOSVO guestOS = _guestOSDao.findById(vm.getGuestOSId());
// Do set dhcp:router option for non-default nic on certain OS(including Windows), and leave other OS unset.
// Because some OS(e.g. CentOS) would set routing on wrong interface
for (String name : _guestOSNeedGatewayOnNonDefaultNetwork) {
if (guestOS.getDisplayName().startsWith(name)) {
needGateway = true;
break;
}
}
}
if (!needGateway) {
gatewayIp = "0.0.0.0";
}
dhcpCommand.setDefaultRouter(gatewayIp);