diff options
| author | Ratan Gupta <ratagupt@in.ibm.com> | 2017-08-18 06:12:26 +0530 |
|---|---|---|
| committer | Patrick Williams <patrick@stwcx.xyz> | 2017-08-24 18:48:00 +0000 |
| commit | c35481dbdbd8e99c47f1be5f24e3eef2d8c442e3 (patch) | |
| tree | b7a34a2426b4b1bbdce8a181e6932d9080e8cc0c | |
| parent | 26e87a0eb3568b4aff8dbaa99a18d68f39f75600 (diff) | |
| download | phosphor-networkd-c35481dbdbd8e99c47f1be5f24e3eef2d8c442e3.tar.gz phosphor-networkd-c35481dbdbd8e99c47f1be5f24e3eef2d8c442e3.zip | |
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>
| -rw-r--r-- | dhcp_configuration.hpp | 13 | ||||
| -rw-r--r-- | ethernet_interface.cpp | 3 | ||||
| -rw-r--r-- | network_config.cpp | 3 |
3 files changed, 15 insertions, 4 deletions
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 @@ class Configuration : public Iface 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 @@ EthernetInterface::EthernetInterface(sdbusplus::bus::bus& bus, 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 @@ void EthernetInterface::writeConfigurationFile() // 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 @@ namespace bmc 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(); } } |

