From 5cc6932d5a011641030ee0464bd7b5381f7d5b1d Mon Sep 17 00:00:00 2001 From: Thomas Haller Date: Fri, 23 Apr 2021 20:14:19 +0200 Subject: [PATCH] dns/resolved: use unique D-Bus name for systemd-resolved request As we already track the current name owner, it seems wrong to make requests to the well-known name. It theoretically opens a race where we would talk to the wrong systemd-resolved instance. So far, we didn't care and it didn't make much of a difference. Still, let's talk to the process that we expect. --- src/core/dns/nm-dns-systemd-resolved.c | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/src/core/dns/nm-dns-systemd-resolved.c b/src/core/dns/nm-dns-systemd-resolved.c index 2704c761b1..8f71a83784 100644 --- a/src/core/dns/nm-dns-systemd-resolved.c +++ b/src/core/dns/nm-dns-systemd-resolved.c @@ -417,16 +417,8 @@ send_updates(NMDnsSystemdResolved *self) continue; } - /* Above we explicitly call "StartServiceByName" trying to avoid D-Bus activating systmd-resolved - * multiple times. There is still a race, were we might hit this line although actually - * the service just quit this very moment. In that case, we would try to D-Bus activate the - * service multiple times during each call (something we wanted to avoid). - * - * But this is hard to avoid, because we'd have to check the error failure to detect the reason - * and retry. The race is not critical, because at worst it results in logging a warning - * about failure to start systemd.resolved. */ g_dbus_connection_call(priv->dbus_connection, - SYSTEMD_RESOLVED_DBUS_SERVICE, + priv->dbus_owner, SYSTEMD_RESOLVED_DBUS_PATH, SYSTEMD_RESOLVED_MANAGER_IFACE, request_item->operation,