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

fix(nm): Fixed dnsmasq behavior on configuration change #5295

Merged
merged 1 commit into from
Jun 27, 2024

Conversation

pierantoniomerlino
Copy link
Contributor

Note: We are using the Conventional Commits convention for our pull request titles. Please take a look at the PR title format document for the supported types and scopes.

This PR fixes a weird behaviour when dnsmasq is used as DHCP server with generic profiles and NM.

Related Issue: This PR fixes/closes N/A

Description of the solution adopted: During testing we found that the dnsmasq used as DHCP server doesn't listen on port 67 after a re-configuration. If the configuration was submitted again, the service starts working as aspected.
After further investigations, we found that when the problem occours, the dnsmasq configuration file is not present in the filesystem. So, the service is running, but without any configuration of the given interface. As a consequence, the port 67 UDP is not used.

This is due to a wrong operation sequence during the DHCP server startup performed by Kura. The configuration file is written, but when the DHCP server activation is triggered, the code disable the service and then re-enable it. During the disable, the configuration file is removed. If a new configuration is submitted again, all works since the bundle doesn’t recognize the service as running and doesn’t disable it.

This PR fixes the issue changing the order of the operation when the DHCP server is configured. Now, the dnsmasq service is disable before that the configuration file is written.

Manual Tests: Using a generic profile, configure an AP with DHCP server enabled. Try to connect to the configured AP with another device (i.e. a laptop) and try to get an IP address. Change the AP configuration and apply it. Then try to connect again with the laptop. The laptop should be able to connect and get the address.

Signed-off-by: pierantoniomerlino <pierantonio.merlino@eurotech.com>
@pierantoniomerlino
Copy link
Contributor Author

@sfiorani could you please check again the AP with generic profiles?

@sfiorani
Copy link
Contributor

@sfiorani could you please check again the AP with generic profiles?

Tested on Raspberry Pi 5 with Kura generic aarch64 and everything seems to work. I tried different combinations of Security and Cipher.

@MMaiero MMaiero merged commit e5737bd into develop Jun 27, 2024
8 checks passed
@MMaiero MMaiero deleted the fix_dnsmasq_dhcp branch June 27, 2024 11:52
github-actions bot pushed a commit that referenced this pull request Jun 27, 2024
Changed operations order in dhcp server configuration

Signed-off-by: pierantoniomerlino <pierantonio.merlino@eurotech.com>
(cherry picked from commit e5737bd)
MMaiero pushed a commit that referenced this pull request Jun 28, 2024
…ease-5.5.0] (#5301)

fix(nm): Fixed dnsmasq behavior on configuration change (#5295)

Changed operations order in dhcp server configuration

Signed-off-by: pierantoniomerlino <pierantonio.merlino@eurotech.com>
(cherry picked from commit e5737bd)

Co-authored-by: Pierantonio Merlino <pierantonio.merlino@eurotech.com>
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