]> git.ipfire.org Git - thirdparty/systemd.git/commit
resolvectl: don't filter loopback DNS server from global DNS server list 25929/head
authorLennart Poettering <lennart@poettering.net>
Wed, 4 Jan 2023 15:36:15 +0000 (16:36 +0100)
committerLennart Poettering <lennart@poettering.net>
Wed, 4 Jan 2023 15:47:40 +0000 (16:47 +0100)
commit889a1b9f4e799b31f1be06db74708aa8beb70829
tree188005ac6ad02ead227482ab13724d81b0d55efa
parent5707fb12978e6818afba379b803da307050f541b
resolvectl: don't filter loopback DNS server from global DNS server list

"resolvectl status" shows per-link DNS servers separately from global
ones. When querying the global list, it will contain both per-link and
global servers however. Thus, to not show duplicate info we filter all
entries that actually have a non-zero ifindex set (under the assumption
that that's a per-link server).

This doesn't work if people configured 127.0.0.1 as global server
though, as we'll add ifindex 1 to it since
6e32414a66ff8dbcef233981a7066684d903ee9f unconditionally even for global
servers.

Let's address that by excluding entries with ifindex 1 from suppression.
This is safe as resolved ignores loopback ifaces, hence never will have
per-link servers on ifindex 1.

Note that this splits up the "with_ifindex" parameter into a second
parameter "only_global", since they semantically do two different
things. One controls whether we shall expect/parse an ifindex dbus
field. The other controls whether we shall filter all ifindex values set
!= 0. These are effectively always used in conjunction hence making them
the same actually worked. However this is utterly confusing I think,
which as I guess is resulting in the confusion around #25796 (which
removes the whole check)

Replaces: #25796
src/resolve/resolvectl.c