<feed xmlns='http://www.w3.org/2005/Atom'>
<title>delta/NetworkManager.git/src/dns, branch th/strsplit</title>
<subtitle>gitlab.freedesktop.org: NetworkManager/NetworkManager.git
</subtitle>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/NetworkManager.git/'/>
<entry>
<title>dns: use GDBusConnection instead of GDBusProxy in "nm-dns-systemd-resolved.c"</title>
<updated>2019-04-09T18:40:18+00:00</updated>
<author>
<name>Thomas Haller</name>
<email>thaller@redhat.com</email>
</author>
<published>2019-04-07T19:45:44+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/NetworkManager.git/commit/?id=5d86f605263200667f2c848f89f3b8831f20bb65'/>
<id>5d86f605263200667f2c848f89f3b8831f20bb65</id>
<content type='text'>
The proxy does nothing for us, except overhead.

We can directly subscribe to "NameOwnerChanged" signals on the
GDBusConnection. Also, instead of asynchronously creating the
GDBusProxy, asynchronously call "GetNameOwner". That's what the
proxy does anyway.

GDBusConnection is actually a decent API. We don't need another layer on
top of that, for functionality that we don't use.

Also, don't use G_BUS_TYPE_SYSTEM, but use the GDBusConnection that
also the bus-manager uses. For all practical purposes, that is the
connection was want to use also in NMDnsSystemdResolved.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The proxy does nothing for us, except overhead.

We can directly subscribe to "NameOwnerChanged" signals on the
GDBusConnection. Also, instead of asynchronously creating the
GDBusProxy, asynchronously call "GetNameOwner". That's what the
proxy does anyway.

GDBusConnection is actually a decent API. We don't need another layer on
top of that, for functionality that we don't use.

Also, don't use G_BUS_TYPE_SYSTEM, but use the GDBusConnection that
also the bus-manager uses. For all practical purposes, that is the
connection was want to use also in NMDnsSystemdResolved.
</pre>
</div>
</content>
</entry>
<entry>
<title>connectivity: avoid D-Bus activating systemd-resolved when we know it's not used</title>
<updated>2019-04-09T18:40:18+00:00</updated>
<author>
<name>Thomas Haller</name>
<email>thaller@redhat.com</email>
</author>
<published>2019-04-07T09:34:30+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/NetworkManager.git/commit/?id=2ab90719a213a3373546469c4c89907a4bf09f16'/>
<id>2ab90719a213a3373546469c4c89907a4bf09f16</id>
<content type='text'>
Every (failed) attempt to D-Bus activate a service results in log-messages
from dbus-daemon. It must be avoided to spam the logs that way.

Let connectivity check not only ask whether systemd-resolved is enabled
(and NetworkManager would like to push information there), but also
whether it looks like the service is actually available. That is,
either it has a name-owner or it's not blocked from starting.

The previous workaround was to configure main.systemd-resolved=no
in NetworkManager.conf. But that requires explict configuration.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Every (failed) attempt to D-Bus activate a service results in log-messages
from dbus-daemon. It must be avoided to spam the logs that way.

Let connectivity check not only ask whether systemd-resolved is enabled
(and NetworkManager would like to push information there), but also
whether it looks like the service is actually available. That is,
either it has a name-owner or it's not blocked from starting.

The previous workaround was to configure main.systemd-resolved=no
in NetworkManager.conf. But that requires explict configuration.
</pre>
</div>
</content>
</entry>
<entry>
<title>dns: only update systemd-resolved when it exists</title>
<updated>2019-04-09T18:40:18+00:00</updated>
<author>
<name>Thomas Haller</name>
<email>thaller@redhat.com</email>
</author>
<published>2019-04-07T08:19:32+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/NetworkManager.git/commit/?id=7ae434b37c9d886807acede55c675b6c82ad6db3'/>
<id>7ae434b37c9d886807acede55c675b6c82ad6db3</id>
<content type='text'>
Previously, we would create the D-Bus proxy without
%G_DBUS_PROXY_FLAGS_DO_NOT_AUTO_START_AT_CONSTRUCTION
flag.

That means, when systemd-resolved was not available or masked, the creation
of the D-Bus proxy would fail with

  dns-sd-resolved[0x561905dc92d0]: failure to create D-Bus proxy for systemd-resolved: Error calling StartServiceByName for org.freedesktop.resolve1: GDBus.Error:org.freedesktop.systemd1.NoSuchUnit: Unit dbus-org.freedesktop.resolve1.service not found.

and never retried.

Now, when creating the D-Bus proxy don't autostart the instance.
Instead, each D-Bus call will try to poke and start the service.

There is a problem however: if systemd-resolved is not available, then
we must not constantly trying to start it, because it results in a slur
or syslog messages from dbus-daemon:

  dbus-daemon[991]: [system] Activating via systemd: service name='org.freedesktop.resolve1' unit='dbus-org.freedesktop.resolve1.service' requested by ':1.23' (uid=0 pid=1012 comm="/usr/bin/NetworkManager --no-daemon ")
  dbus-daemon[991]: [system] Activation via systemd failed for unit 'dbus-org.freedesktop.resolve1.service': Unit dbus-org.freedesktop.resolve1.service not found.
  dbus-daemon[991]: [system] Activating via systemd: service name='org.freedesktop.resolve1' unit='dbus-org.freedesktop.resolve1.service' requested by ':1.23' (uid=0 pid=1012 comm="/usr/bin/NetworkManager --no-daemon ")

Avoid that by watching the name owner.

But, since systemd-resolved is D-Bus activated, watching the name owner
alone is not enough to know whether we should try to autostart the service.

Instead:

 - if we have a name owner, assume the service runs and we send the update

 - if we have no name owner, and we did not recently try to start
   the service by name, poke it via "StartServiceByName". The idea
   is, that in total we only try this once and remember a previous
   attempt in priv-&gt;try_start_blocked.

 - if we get a name-owner, priv-&gt;try_start_blocked gets reset.
   Either it was us who started the service, or somebody else.
   Either way, we are good to send updates again.

The nice thing is that we only try once to start resolved and only
generate one logging message from dbus-daemon about failure to do so.
But still, after blocking start on failure, when somebody else starts
resolved, we notice it and start using it again.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Previously, we would create the D-Bus proxy without
%G_DBUS_PROXY_FLAGS_DO_NOT_AUTO_START_AT_CONSTRUCTION
flag.

That means, when systemd-resolved was not available or masked, the creation
of the D-Bus proxy would fail with

  dns-sd-resolved[0x561905dc92d0]: failure to create D-Bus proxy for systemd-resolved: Error calling StartServiceByName for org.freedesktop.resolve1: GDBus.Error:org.freedesktop.systemd1.NoSuchUnit: Unit dbus-org.freedesktop.resolve1.service not found.

and never retried.

Now, when creating the D-Bus proxy don't autostart the instance.
Instead, each D-Bus call will try to poke and start the service.

There is a problem however: if systemd-resolved is not available, then
we must not constantly trying to start it, because it results in a slur
or syslog messages from dbus-daemon:

  dbus-daemon[991]: [system] Activating via systemd: service name='org.freedesktop.resolve1' unit='dbus-org.freedesktop.resolve1.service' requested by ':1.23' (uid=0 pid=1012 comm="/usr/bin/NetworkManager --no-daemon ")
  dbus-daemon[991]: [system] Activation via systemd failed for unit 'dbus-org.freedesktop.resolve1.service': Unit dbus-org.freedesktop.resolve1.service not found.
  dbus-daemon[991]: [system] Activating via systemd: service name='org.freedesktop.resolve1' unit='dbus-org.freedesktop.resolve1.service' requested by ':1.23' (uid=0 pid=1012 comm="/usr/bin/NetworkManager --no-daemon ")

Avoid that by watching the name owner.

But, since systemd-resolved is D-Bus activated, watching the name owner
alone is not enough to know whether we should try to autostart the service.

Instead:

 - if we have a name owner, assume the service runs and we send the update

 - if we have no name owner, and we did not recently try to start
   the service by name, poke it via "StartServiceByName". The idea
   is, that in total we only try this once and remember a previous
   attempt in priv-&gt;try_start_blocked.

 - if we get a name-owner, priv-&gt;try_start_blocked gets reset.
   Either it was us who started the service, or somebody else.
   Either way, we are good to send updates again.

The nice thing is that we only try once to start resolved and only
generate one logging message from dbus-daemon about failure to do so.
But still, after blocking start on failure, when somebody else starts
resolved, we notice it and start using it again.
</pre>
</div>
</content>
</entry>
<entry>
<title>dns: ratelimit warnings about failure to send updates to NMDnsSystemdResolved</title>
<updated>2019-04-09T18:40:18+00:00</updated>
<author>
<name>Thomas Haller</name>
<email>thaller@redhat.com</email>
</author>
<published>2019-04-07T08:23:50+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/NetworkManager.git/commit/?id=308e9e69fa821d2de072981c262523b292dadefc'/>
<id>308e9e69fa821d2de072981c262523b292dadefc</id>
<content type='text'>
As we frequently send updates to systemd-resolved and for each update
send multiple messages, it can happen that we log a large number of
warnings if they all fail.

Rate limit the warnings to only warn once (until the failure is
recovered).

Currently, if systemd-resolved is not installed (or disabled) we already
fail once to create the D-Bus proxy (and never retry). That should be
fixed, to create the proxy with G_DBUS_PROXY_FLAGS_DO_NOT_AUTO_START_AT_CONSTRUCTION.
If we allow creating the proxy we would repeatedly try to send messages
and they would all fail. This is one example, where we need to ratelimit
the warning.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
As we frequently send updates to systemd-resolved and for each update
send multiple messages, it can happen that we log a large number of
warnings if they all fail.

Rate limit the warnings to only warn once (until the failure is
recovered).

Currently, if systemd-resolved is not installed (or disabled) we already
fail once to create the D-Bus proxy (and never retry). That should be
fixed, to create the proxy with G_DBUS_PROXY_FLAGS_DO_NOT_AUTO_START_AT_CONSTRUCTION.
If we allow creating the proxy we would repeatedly try to send messages
and they would all fail. This is one example, where we need to ratelimit
the warning.
</pre>
</div>
</content>
</entry>
<entry>
<title>dns: log about what NMDnsSystemdResolved is doing</title>
<updated>2019-04-09T18:40:18+00:00</updated>
<author>
<name>Thomas Haller</name>
<email>thaller@redhat.com</email>
</author>
<published>2019-04-07T08:07:06+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/NetworkManager.git/commit/?id=6f663b8f8e943b3330a9be7c31e3bbf98a99d149'/>
<id>6f663b8f8e943b3330a9be7c31e3bbf98a99d149</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>dns: fix meanleak in nm-dns-systemd-resolved's call_done()</title>
<updated>2019-04-09T18:40:18+00:00</updated>
<author>
<name>Thomas Haller</name>
<email>thaller@redhat.com</email>
</author>
<published>2019-04-07T19:47:55+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/NetworkManager.git/commit/?id=759927f99e9927b5564cfbba8465378ce2426e9e'/>
<id>759927f99e9927b5564cfbba8465378ce2426e9e</id>
<content type='text'>
Fixes: 818023c257ca ('dns/resolved: add systemd-resolved backend')
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Fixes: 818023c257ca ('dns/resolved: add systemd-resolved backend')
</pre>
</div>
</content>
</entry>
<entry>
<title>dns: fix memory leak of error</title>
<updated>2019-03-26T16:37:54+00:00</updated>
<author>
<name>Beniamino Galvani</name>
<email>bgalvani@redhat.com</email>
</author>
<published>2019-03-26T13:10:07+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/NetworkManager.git/commit/?id=579373a5dfc98b0d39deaf1c12a1b492ac6c4e40'/>
<id>579373a5dfc98b0d39deaf1c12a1b492ac6c4e40</id>
<content type='text'>
The error was leaked when cancelled.

Fixes: 818023c257ca ('dns/resolved: add systemd-resolved backend')
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The error was leaked when cancelled.

Fixes: 818023c257ca ('dns/resolved: add systemd-resolved backend')
</pre>
</div>
</content>
</entry>
<entry>
<title>all: replace strerror() calls with nm_strerror_native()</title>
<updated>2019-02-12T07:50:28+00:00</updated>
<author>
<name>Thomas Haller</name>
<email>thaller@redhat.com</email>
</author>
<published>2019-01-31T16:22:18+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/NetworkManager.git/commit/?id=9beed4f661d0b8e02c16a616e7491baa42af0843'/>
<id>9beed4f661d0b8e02c16a616e7491baa42af0843</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>all: replace g_strerror() calls with nm_strerror_native()</title>
<updated>2019-02-12T07:50:28+00:00</updated>
<author>
<name>Thomas Haller</name>
<email>thaller@redhat.com</email>
</author>
<published>2019-01-31T16:08:03+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/NetworkManager.git/commit/?id=a4fb6ddfca60c50cdf140d3f388209ace06e24ff'/>
<id>a4fb6ddfca60c50cdf140d3f388209ace06e24ff</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>all: cache errno in local variable before using it</title>
<updated>2019-02-12T07:50:28+00:00</updated>
<author>
<name>Thomas Haller</name>
<email>thaller@redhat.com</email>
</author>
<published>2019-01-31T12:29:21+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/NetworkManager.git/commit/?id=047998f80a8686f5200cd48d31349c977f9a50b7'/>
<id>047998f80a8686f5200cd48d31349c977f9a50b7</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
</feed>
