Change the dhcp configuration parameters default value to true

set the link local addressing to yes so that the interface gets
the zeroconfig ip, if unable to get the ip from DHCP server.

Change-Id: I7e5351662c45863e3d15d49151bfdfb8d9096e11
Signed-off-by: Ratan Gupta <ratagupt@in.ibm.com>
diff --git a/dhcp_configuration.hpp b/dhcp_configuration.hpp
index e6e549f..f486f22 100644
--- a/dhcp_configuration.hpp
+++ b/dhcp_configuration.hpp
@@ -49,9 +49,18 @@
         Configuration(sdbusplus::bus::bus& bus,
                       const std::string& objPath,
                       Manager& parent) :
-            Iface(bus, objPath.c_str()),
+            Iface(bus, objPath.c_str(), true),
             bus(bus),
-            manager(parent){}
+            manager(parent)
+        {
+            // systemd default behaviour is following fields should be
+            // enabled by default.
+
+            ConfigIntf::dNSEnabled(true);
+            ConfigIntf::nTPEnabled(true);
+            ConfigIntf::hostNameEnabled(true);
+            emit_object_added();
+        }
 
         /** @brief If true then DNS servers received from the DHCP server
          *         will be used and take precedence over any statically
diff --git a/ethernet_interface.cpp b/ethernet_interface.cpp
index f31c210..ac138f3 100644
--- a/ethernet_interface.cpp
+++ b/ethernet_interface.cpp
@@ -50,7 +50,7 @@
     auto intfName = objPath.substr(objPath.rfind("/") + 1);
     std::replace(intfName.begin(), intfName.end(), '_', '.');
     interfaceName(intfName);
-    dHCPEnabled(dhcpEnabled);
+    EthernetInterfaceIntf::dHCPEnabled(dhcpEnabled);
     mACAddress(getMACAddress(intfName));
 
     // Emit deferred signal.
@@ -426,6 +426,7 @@
 
     // write the network section
     stream << "[" << "Network" << "]\n";
+    stream << "LinkLocalAddressing=yes\n";
     // DHCP
     if (dHCPEnabled() == true)
     {
diff --git a/network_config.cpp b/network_config.cpp
index 4540ad8..d0aa2b4 100644
--- a/network_config.cpp
+++ b/network_config.cpp
@@ -16,7 +16,8 @@
 
         filestream.open(filename);
         filestream << "[Match]\nName=" << interface <<
-                "\n[Network]\nDHCP=true\n[DHCP]\nClientIdentifier=mac\n";
+                "\n[Network]\nDHCP=true\nLinkLocalAddressing=yes\n"
+                "[DHCP]\nClientIdentifier=mac\n";
         filestream.close();
     }
 }