summaryrefslogtreecommitdiffstats
path: root/ethernet_interface.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'ethernet_interface.cpp')
-rw-r--r--ethernet_interface.cpp22
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)
OpenPOWER on IntegriCloud