Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(dnsmasq): support for multiple DHCP server interfaces #4529

Conversation

marcellorinaldo
Copy link
Contributor

@marcellorinaldo marcellorinaldo commented Apr 5, 2023

This PR writes the dnsmasq configuration so that each property has associated a connection label, allowing for multiple interfaces to be set as DHCP server at the same time.

Related Issue: N/A.

Description of the solution adopted: The dhcp-range property creates a label for each activated interface. Each DHCP interface configuration is put on a file that follows the pattern:

/etc/dnsmasq.d/dnsmasq-<ifname>.conf

It is not allowed in dnsmasq to have global settings specified more than once across all files. Hence, a global configuration is written and maintained by the DHCP server manager. The created global configuration file is:

/etc/dnsmasq.d/dnsmasq-globals.conf

Screenshots: N/A.

Any side note on the changes made: Created more robust way to detect change in configuration in the method isRunning. It wouldn't trigger on NM configuration update.

@marcellorinaldo marcellorinaldo force-pushed the dnsmasq-support-multiple-dhcp-interfaces branch from cb5d773 to 5525951 Compare April 6, 2023 09:29
@marcellorinaldo
Copy link
Contributor Author

Tests missing, will add in different PR

@MMaiero
Copy link
Contributor

MMaiero commented Apr 7, 2023

@marcellorinaldo The tests are failing. Can you please check?

@marcellorinaldo
Copy link
Contributor Author

@marcellorinaldo The tests are failing. Can you please check?

Forgot to update couple of test cases.

@marcellorinaldo
Copy link
Contributor Author

marcellorinaldo commented Apr 7, 2023

The current tests error seem unrelated to this PR and might be solved in #4544, will rebase after that merge.

@mattdibi mattdibi force-pushed the dnsmasq-support-multiple-dhcp-interfaces branch from 3afdeae to d12fe49 Compare April 7, 2023 08:54
@MMaiero
Copy link
Contributor

MMaiero commented Apr 8, 2023

Merging due to the need to build RC2. @marcellorinaldo please add coverage as required https://sonarcloud.io/component_measures?id=org.eclipse.kura%3Akura&branch=PR-4529&metric=new_coverage&view=list

@MMaiero MMaiero merged commit 51bd7c2 into eclipse-kura:develop Apr 8, 2023
@MMaiero MMaiero deleted the dnsmasq-support-multiple-dhcp-interfaces branch April 8, 2023 12:20
github-actions bot pushed a commit that referenced this pull request Apr 8, 2023
* fix(dnsmasq): configs are for specific interfaces, removed global options

Signed-off-by: Marcello Martina <[email protected]>

* feat(linux.net.dhcp.server): addes dnsmasq more robust isRunning detection, manage global confs file

Signed-off-by: Marcello Martina <[email protected]>

* build(test): versions refactor

Signed-off-by: Marcello Martina <[email protected]>

* style: added constants

Signed-off-by: Marcello Martina <[email protected]>

* fix: applied review suggestions

Signed-off-by: Marcello Martina <[email protected]>

* fix: the router is always passed, since by default it is the localhost

Signed-off-by: Marcello Martina <[email protected]>

* fix: disabled option 6 when passDns=false

Signed-off-by: Marcello Martina <[email protected]>

* test: updated dnsmasq test case

Signed-off-by: Marcello Martina <[email protected]>

* fix: dhcp option key duplication

Signed-off-by: MMaiero <[email protected]>

---------

Signed-off-by: Marcello Martina <[email protected]>
Signed-off-by: MMaiero <[email protected]>
Co-authored-by: MMaiero <[email protected]>
(cherry picked from commit 51bd7c2)
MMaiero pushed a commit that referenced this pull request Apr 8, 2023
…release-5.3.0] (#4561)

feat(dnsmasq): support for multiple DHCP server interfaces (#4529)

* fix(dnsmasq): configs are for specific interfaces, removed global options

Signed-off-by: Marcello Martina <[email protected]>

* feat(linux.net.dhcp.server): addes dnsmasq more robust isRunning detection, manage global confs file

Signed-off-by: Marcello Martina <[email protected]>

* build(test): versions refactor

Signed-off-by: Marcello Martina <[email protected]>

* style: added constants

Signed-off-by: Marcello Martina <[email protected]>

* fix: applied review suggestions

Signed-off-by: Marcello Martina <[email protected]>

* fix: the router is always passed, since by default it is the localhost

Signed-off-by: Marcello Martina <[email protected]>

* fix: disabled option 6 when passDns=false

Signed-off-by: Marcello Martina <[email protected]>

* test: updated dnsmasq test case

Signed-off-by: Marcello Martina <[email protected]>

* fix: dhcp option key duplication

Signed-off-by: MMaiero <[email protected]>

---------

Signed-off-by: Marcello Martina <[email protected]>
Signed-off-by: MMaiero <[email protected]>
Co-authored-by: MMaiero <[email protected]>
(cherry picked from commit 51bd7c2)

Co-authored-by: Marcello Rinaldo Martina <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants