]> git.ipfire.org Git - thirdparty/systemd.git/commit
resolved: rework how we reply to D-Bus messages for resolution requests 22546/head
authorLennart Poettering <lennart@poettering.net>
Thu, 17 Feb 2022 10:48:31 +0000 (11:48 +0100)
committerLennart Poettering <lennart@poettering.net>
Fri, 18 Feb 2022 17:50:24 +0000 (18:50 +0100)
commit2471a977b176d8baf1195a17fa6849ea6b1ab750
tree45e2b2857d4e834bdeb5a127f23ae1be81d01f27
parent08275791d85a1852e79951212f6cbbc727db789a
resolved: rework how we reply to D-Bus messages for resolution requests

This reworks how we reply to D-Bus messages that come in for resolution
requests. Previously, we'd store them in the .bus_request field of
the main DnsQuery (but not any auxiliary one), and reply to it whenever
we had something to reply. In error paths this could mean we'd
accidentally reply twice.

This cleans this logic up: whenever we reply to a message we'll now go up
the tree of auxiliary queries, to find the primary query, i.e. the one
we actually want to reply to. Once we found it, we take out the bus
message object, resetting it to NULL. This way we can be sure we'll
reply at most once to each message.

Fixes: #22477
src/resolve/resolved-bus.c