fix(nm): load dhcp server configuration after change #5018
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
While performing some tests we discovered an issue affecting the DHCP servers: when changing a DHCP server configuration (i.e. on a network interface already running a DHCP server, we just change the DHCP Address range) the configuration change was not taking effect. We could see the DHCP server configuration file changing on disk, but the server was still serving the same address ranges.
This was due to the fact that, when migrating to the new networking, we preserved the monitors but, when updating DHCP server configurations, we forgot to add the required step to reload the configuration.
You can see that, in the old networking, the step for updating the DHCP server configuration includes a
disable
call which later relies on the monitors to set the DHCP server back up.https://github.com/eclipse/kura/blob/aa87f66ab3e31fcf6b681da78ac62673c2ef50d4/kura/org.eclipse.kura.linux.net/src/main/java/org/eclipse/kura/linux/net/dhcp/DhcpServerImpl.java#L231-L250
https://github.com/eclipse/kura/blob/aa87f66ab3e31fcf6b681da78ac62673c2ef50d4/kura/org.eclipse.kura.linux.net/src/main/java/org/eclipse/kura/linux/net/dhcp/DhcpServerImpl.java#L168-L192
This step was missing in the new networking (i.e. org.eclipse.kura.nm). This PR introduces the
disable
step back but delegates the responsibility to the monitors themselves, since the DHCP server monitor is responsible for the DHCP server service lifecycle.