Allow static configuration of NTP and DNS in DHCP mode

Before this fix we don't allow the static DNS or NTP configuration
this fix is removing that limitation and allow the static NTP
and DNS configuration in DHCP mode.

Change-Id: I5a909373ee1eaff850cf96622451af6acfaddcc3
Signed-off-by: Ratan Gupta <ratagupt@linux.vnet.ibm.com>
diff --git a/ethernet_interface.cpp b/ethernet_interface.cpp
index f609b9d..38efcb4 100644
--- a/ethernet_interface.cpp
+++ b/ethernet_interface.cpp
@@ -459,7 +459,6 @@
     try
     {
         EthernetInterfaceIntf::nameservers(value);
-
         writeConfigurationFile();
         // resolved reads the DNS server configuration from the
         // network file.
@@ -650,6 +649,18 @@
         stream << "VLAN=" << intf.second->EthernetInterface::interfaceName()
                << "\n";
     }
+    // Add the NTP server
+    for (const auto& ntp : EthernetInterfaceIntf::nTPServers())
+    {
+        stream << "NTP=" << ntp << "\n";
+    }
+
+    // Add the DNS entry
+    for (const auto& dns : EthernetInterfaceIntf::nameservers())
+    {
+        stream << "DNS=" << dns << "\n";
+    }
+
     // Add the DHCP entry
     auto value = dHCPEnabled() ? "true"s : "false"s;
     stream << "DHCP="s + value + "\n";
@@ -658,18 +669,6 @@
     // in config file.
     if (dHCPEnabled() == false)
     {
-        // Add the NTP server
-        for (const auto& ntp : EthernetInterfaceIntf::nTPServers())
-        {
-            stream << "NTP=" << ntp << "\n";
-        }
-
-        // Add the DNS entry
-        for (const auto& dns : EthernetInterfaceIntf::nameservers())
-        {
-            stream << "DNS=" << dns << "\n";
-        }
-
         // Static
         for (const auto& addr : addrs)
         {