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

Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/5280a699
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/5280a699
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/5280a699

Branch: refs/heads/advancedsg-leaseweb
Commit: 5280a69937b32d79c3874ce4ec56f4e2fdf0f3ea
Parents: cc9b60f
Author: Anthony Xu <[email protected]>
Authored: Wed May 29 16:51:42 2013 -0700
Committer: Wei Zhou <[email protected]>
Committed: Tue Jun 11 11:07:44 2013 +0200

----------------------------------------------------------------------
 .../router/VirtualNetworkApplianceManagerImpl.java  | 16 ++--------------
 1 file changed, 2 insertions(+), 14 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/5280a699/server/src/com/cloud/network/router/VirtualNetworkApplianceManagerImpl.java
----------------------------------------------------------------------
diff --git 
a/server/src/com/cloud/network/router/VirtualNetworkApplianceManagerImpl.java 
b/server/src/com/cloud/network/router/VirtualNetworkApplianceManagerImpl.java
index b43b455..dd8297a 100755
--- 
a/server/src/com/cloud/network/router/VirtualNetworkApplianceManagerImpl.java
+++ 
b/server/src/com/cloud/network/router/VirtualNetworkApplianceManagerImpl.java
@@ -3128,21 +3128,9 @@ public class VirtualNetworkApplianceManagerImpl extends 
ManagerBase implements V
     private void createDhcpEntryCommand(VirtualRouter router, UserVm vm, NicVO 
nic, Commands cmds) {
         DhcpEntryCommand dhcpCommand = new 
DhcpEntryCommand(nic.getMacAddress(), nic.getIp4Address(), vm.getHostName(), 
nic.getIp6Address());
         DataCenterVO dcVo = _dcDao.findById(router.getDataCenterId());
-        String gatewayIp = findGatewayIp(vm.getId());
-        boolean needGateway = true;
+        Nic defaultNic = findGatewayIp(vm.getId());
+        String gatewayIp = defaultNic.getGateway();
         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);

Reply via email to