diff options
author | Ratan Gupta <ratagupt@in.ibm.com> | 2017-08-28 22:18:21 +0530 |
---|---|---|
committer | Patrick Williams <patrick@stwcx.xyz> | 2017-08-31 15:37:22 +0000 |
commit | 4f67dac2061f5fafbae83aba9d44029b994275a7 (patch) | |
tree | c525a39f31de3e828147f99e916c0d2867bf6194 /ethernet_interface.cpp | |
parent | e8d42112b94dbb8fb90cc90443cf99673935d2ae (diff) | |
download | phosphor-networkd-4f67dac2061f5fafbae83aba9d44029b994275a7.tar.gz phosphor-networkd-4f67dac2061f5fafbae83aba9d44029b994275a7.zip |
DHCP value was not getting updated correctly
This commit fixes
=>Disable zeroconf.
=>Correct the network conf file path in factory reset.
=>Updating the DHCP value correctly.
Resolves openbmc/openbmc#2230
Resolves openbmc/openbmc#2215
Change-Id: I8f87c2afb53cc952755165d34bfb62b8aba80fe5
Signed-off-by: Ratan Gupta <ratagupt@in.ibm.com>
Diffstat (limited to 'ethernet_interface.cpp')
-rw-r--r-- | ethernet_interface.cpp | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/ethernet_interface.cpp b/ethernet_interface.cpp index ac138f3..c24a3e8 100644 --- a/ethernet_interface.cpp +++ b/ethernet_interface.cpp @@ -327,11 +327,8 @@ bool EthernetInterface::dHCPEnabled(bool value) } EthernetInterfaceIntf::dHCPEnabled(value); - if (value) - { - writeConfigurationFile(); - createIPAddressObjects(); - } + writeConfigurationFile(); + createIPAddressObjects(); return value; } @@ -426,7 +423,14 @@ void EthernetInterface::writeConfigurationFile() // write the network section stream << "[" << "Network" << "]\n"; - stream << "LinkLocalAddressing=yes\n"; + + // Add the VLAN entry + for (const auto& intf: vlanInterfaces) + { + stream << "VLAN=" << intf.second->EthernetInterface::interfaceName() + << "\n"; + } + // DHCP if (dHCPEnabled() == true) { @@ -434,13 +438,9 @@ void EthernetInterface::writeConfigurationFile() // configured as dhcp. writeDHCPSection(stream); stream.close(); + restartSystemdUnit("systemd-networkd.service"); return; } - // Add the Vlan entry - for(const auto& intf: vlanInterfaces) - { - stream << "VLAN=" << intf.second->EthernetInterface::interfaceName() << "\n"; - } // Static for (const auto& addr : addrs) |