]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core.git/commitdiff
connman: Set connman resolv.conf as fallback when using systemd-resolved
authorStefan Eichenberger <stefan.eichenberger@toradex.com>
Thu, 29 May 2025 13:55:36 +0000 (10:55 -0300)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Mon, 2 Jun 2025 21:17:21 +0000 (22:17 +0100)
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>
Signed-off-by: Mathieu Dubois-Briand <mathieu.dubois-briand@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
meta/recipes-connectivity/connman/connman_1.44.bb

index 02c5be929e0a07c96807879b55750411e1e8a1ca..1b0fbe438c7afc6643081c3554376ff081c6891e 100644 (file)
@@ -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)}"