Skip to content

Commit 90bdc8b

Browse files
floklipoettering
authored andcommitted
resolved-dns-query: remove dns_query_candidate_is_routable
Resolved can't reliably determine on whether "it makes sense" to query AAAA records when not explicitly specifying it in the request, so we shouldn't remove them. After having done the resolving, applications can use RFC6724 to determine whether that address is reachable. We can't know whether an address is reachable before having resolved it and inspecting the routing table, and not resolving AAAA just because there's no IPv6 default route on the main interface link them breaks various setups, including IPv6-providing wireguard tunnels on a non-dualstacked environment. Fixes systemd#5782 Fixes systemd#5915 Fixes systemd#8017
1 parent e6190e2 commit 90bdc8b

File tree

1 file changed

+0
-28
lines changed

1 file changed

+0
-28
lines changed

src/resolve/resolved-dns-query.c

Lines changed: 0 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -212,31 +212,6 @@ static DnsTransactionState dns_query_candidate_state(DnsQueryCandidate *c) {
212212
return state;
213213
}
214214

215-
static bool dns_query_candidate_is_routable(DnsQueryCandidate *c, uint16_t type) {
216-
int family;
217-
218-
assert(c);
219-
220-
/* Checks whether the specified RR type matches an address family that is routable on the link(s) the scope of
221-
* this candidate belongs to. Specifically, whether there's a routable IPv4 address on it if we query an A RR,
222-
* or a routable IPv6 address if we query an AAAA RR. */
223-
224-
if (!c->query->suppress_unroutable_family)
225-
return true;
226-
227-
if (c->scope->protocol != DNS_PROTOCOL_DNS)
228-
return true;
229-
230-
family = dns_type_to_af(type);
231-
if (family < 0)
232-
return true;
233-
234-
if (c->scope->link)
235-
return link_relevant(c->scope->link, family, false);
236-
else
237-
return manager_routable(c->scope->manager, family);
238-
}
239-
240215
static int dns_query_candidate_setup_transactions(DnsQueryCandidate *c) {
241216
DnsQuestion *question;
242217
DnsResourceKey *key;
@@ -253,9 +228,6 @@ static int dns_query_candidate_setup_transactions(DnsQueryCandidate *c) {
253228
_cleanup_(dns_resource_key_unrefp) DnsResourceKey *new_key = NULL;
254229
DnsResourceKey *qkey;
255230

256-
if (!dns_query_candidate_is_routable(c, key->type))
257-
continue;
258-
259231
if (c->search_domain) {
260232
r = dns_resource_key_new_append_suffix(&new_key, key, c->search_domain->name);
261233
if (r < 0)

0 commit comments

Comments
 (0)