diff mbox series

connman: Set connman resolv.conf as fallback when using systemd-resolved

Message ID 20250529135536.254640-1-hiagofranco@gmail.com
State New
Headers show
Series connman: Set connman resolv.conf as fallback when using systemd-resolved | expand

Commit Message

Hiago De Franco May 29, 2025, 1:55 p.m. UTC
From: Stefan Eichenberger <stefan.eichenberger@toradex.com>

Commit bec0cfc9b215 ("connman: Set dns-backend automatically") introduced
support for using systemd-resolved as the DNS backend. However,
connman's resolv.conf was assigned a higher update-alternatives
priority. This caused connman's configuration to override
systemd-resolved, resulting in a broken DNS setup.
/etc/resolv.conf -> /etc/resolv-conf.connman

This commit corrects the issue by lowering the priority for connman's
resolv.conf when systemd-resolved is enabled, ensuring it acts as
a fallback. The higher priority is now only applied when
systemd-resolved is not used.

Fixes: bec0cfc9b215 ("connman: Set dns-backend automatically")
Signed-off-by: Stefan Eichenberger <stefan.eichenberger@toradex.com>
Signed-off-by: Hiago De Franco <hiago.franco@toradex.com>
---
 meta/recipes-connectivity/connman/connman_1.44.bb | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/meta/recipes-connectivity/connman/connman_1.44.bb b/meta/recipes-connectivity/connman/connman_1.44.bb
index 02c5be929e0a..1b0fbe438c7a 100644
--- a/meta/recipes-connectivity/connman/connman_1.44.bb
+++ b/meta/recipes-connectivity/connman/connman_1.44.bb
@@ -92,7 +92,7 @@  SYSTEMD_SERVICE:${PN} = "connman.service"
 SYSTEMD_SERVICE:${PN}-vpn = "connman-vpn.service"
 SYSTEMD_SERVICE:${PN}-wait-online = "connman-wait-online.service"
 
-ALTERNATIVE_PRIORITY = "100"
+ALTERNATIVE_PRIORITY = "${@bb.utils.contains('DISTRO_FEATURES','systemd-resolved','10','100',d)}"
 ALTERNATIVE:${PN} = "${@bb.utils.contains('DISTRO_FEATURES','systemd','resolv-conf','',d)}"
 ALTERNATIVE_TARGET[resolv-conf] = "${@bb.utils.contains('DISTRO_FEATURES','systemd','${sysconfdir}/resolv-conf.connman','',d)}"
 ALTERNATIVE_LINK_NAME[resolv-conf] = "${@bb.utils.contains('DISTRO_FEATURES','systemd','${sysconfdir}/resolv.conf','',d)}"