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.
This commit is contained in:
Thomas Haller 2021-04-23 20:14:19 +02:00
parent e7d78e90a3
commit 5cc6932d5a
No known key found for this signature in database
GPG key ID: 29C2366E4DFC5728

View file

@ -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,