Skip to content

Commit

Permalink
fix(nm): Fixed dnsmasq behavior on configuration change (#5295)
Browse files Browse the repository at this point in the history
Changed operations order in dhcp server configuration

Signed-off-by: pierantoniomerlino <pierantonio.merlino@eurotech.com>
  • Loading branch information
pierantoniomerlino authored Jun 27, 2024
1 parent 2b15c00 commit e5737bd
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
import java.util.Set;
import java.util.regex.Pattern;
import java.util.stream.Collectors;

import org.eclipse.kura.KuraErrorCode;
import org.eclipse.kura.KuraException;
import org.eclipse.kura.configuration.ComponentConfiguration;
Expand Down Expand Up @@ -505,11 +506,11 @@ private void writeDhcpServerConfiguration(Set<String> interfaceNames) {
DhcpServerConfigWriter dhcpServerConfigWriter = buildDhcpServerConfigWriter(interfaceName,
this.networkProperties);
try {
dhcpServerConfigWriter.writeConfiguration();
this.dhcpServerMonitor.putDhcpServerInterfaceConfiguration(interfaceName, true);
this.dhcpServerMonitor.disable(interfaceName); // Side effect: we rely on the monitor bringing the
// server back up so that the configuration change
// takes effect
dhcpServerConfigWriter.writeConfiguration();
this.dhcpServerMonitor.putDhcpServerInterfaceConfiguration(interfaceName, true);

} catch (UnknownHostException | KuraException e) {
logger.error("Failed to write DHCP Server configuration", e);
Expand Down

0 comments on commit e5737bd

Please sign in to comment.