From 02a9fd951e11ddfe37313c44e3f160bec6d8c6a7 Mon Sep 17 00:00:00 2001 From: pierantoniomerlino Date: Wed, 26 Jun 2024 14:11:53 +0200 Subject: [PATCH] Changed operations order in dhcp server configuration Signed-off-by: pierantoniomerlino --- .../kura/nm/configuration/NMConfigurationServiceImpl.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/kura/org.eclipse.kura.nm/src/main/java/org/eclipse/kura/nm/configuration/NMConfigurationServiceImpl.java b/kura/org.eclipse.kura.nm/src/main/java/org/eclipse/kura/nm/configuration/NMConfigurationServiceImpl.java index 68c3c2fbf3b..a19561ade62 100644 --- a/kura/org.eclipse.kura.nm/src/main/java/org/eclipse/kura/nm/configuration/NMConfigurationServiceImpl.java +++ b/kura/org.eclipse.kura.nm/src/main/java/org/eclipse/kura/nm/configuration/NMConfigurationServiceImpl.java @@ -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; @@ -505,11 +506,11 @@ private void writeDhcpServerConfiguration(Set 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);