Move DHCP=xxx to Network section in n/w config file.

With the changes done for the issue #2891, we are adding DHCP section
always into n/w config file, irrespective of DHCP enabled or not.
With those new changes when DHCP is disabled(i.e in static case)
DHCP=xxx entry is getting added into Route section and causing the
issue.

Resolves openbmc/openbmc#3030

Change-Id: I97b30129de97eff5d25e78a09e9cb713c45ad4a7
Signed-off-by: Nagaraju Goruganti <ngorugan@in.ibm.com>
diff --git a/ethernet_interface.cpp b/ethernet_interface.cpp
index 74c30c5..e388fa8 100644
--- a/ethernet_interface.cpp
+++ b/ethernet_interface.cpp
@@ -564,6 +564,10 @@
         stream << "VLAN=" << intf.second->EthernetInterface::interfaceName()
             << "\n";
     }
+    // Add the DHCP entry
+    auto value = dHCPEnabled() ? "true"s : "false"s;
+    stream << "DHCP="s + value + "\n";
+
     // When the interface configured as dhcp, we don't need below given entries
     // in config file.
     if (dHCPEnabled() == false)
@@ -624,9 +628,6 @@
         }
     }
 
-    auto value = dHCPEnabled() ? "true"s : "false"s;
-    stream << "DHCP="s + value + "\n";
-
     // Write the dhcp section irrespective of whether DHCP is enabled or not
     writeDHCPSection(stream);