chiark
/
gitweb
/
~ianmdlvl
/
elogind.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
journald: allow restarting journald without losing stream connections
[elogind.git]
/
src
/
resolve
/
resolved-dns-query.c
diff --git
a/src/resolve/resolved-dns-query.c
b/src/resolve/resolved-dns-query.c
index 6d77c109b4ec5002c7b4edf16152f2fe9b48b0d0..f0483c98069f357b72f60a161842527ba8e369a2 100644
(file)
--- a/
src/resolve/resolved-dns-query.c
+++ b/
src/resolve/resolved-dns-query.c
@@
-66,7
+66,7
@@
DnsQuery *dns_query_free(DnsQuery *q) {
return NULL;
}
return NULL;
}
-int dns_query_new(Manager *m, DnsQuery **ret, DnsQuestion *question) {
+int dns_query_new(Manager *m, DnsQuery **ret, DnsQuestion *question
, int ifindex, uint64_t flags
) {
_cleanup_(dns_query_freep) DnsQuery *q = NULL;
unsigned i;
int r;
_cleanup_(dns_query_freep) DnsQuery *q = NULL;
unsigned i;
int r;
@@
-86,6
+86,8
@@
int dns_query_new(Manager *m, DnsQuery **ret, DnsQuestion *question) {
return -ENOMEM;
q->question = dns_question_ref(question);
return -ENOMEM;
q->question = dns_question_ref(question);
+ q->ifindex = ifindex;
+ q->flags = flags;
for (i = 0; i < question->n_keys; i++) {
_cleanup_free_ char *p;
for (i = 0; i < question->n_keys; i++) {
_cleanup_free_ char *p;
@@
-142,7
+144,7
@@
static int dns_query_add_transaction(DnsQuery *q, DnsScope *s, DnsResourceKey *k
assert(q);
assert(s);
assert(q);
assert(s);
- r = set_ensure_allocated(&q->transactions, NULL
, NULL
);
+ r = set_ensure_allocated(&q->transactions, NULL);
if (r < 0)
return r;
if (r < 0)
return r;
@@
-164,7
+166,7
@@
static int dns_query_add_transaction(DnsQuery *q, DnsScope *s, DnsResourceKey *k
return r;
}
return r;
}
- r = set_ensure_allocated(&t->queries, NULL
, NULL
);
+ r = set_ensure_allocated(&t->queries, NULL);
if (r < 0)
goto gc;
if (r < 0)
goto gc;
@@
-233,7
+235,7
@@
int dns_query_go(DnsQuery *q) {
LIST_FOREACH(scopes, s, q->manager->dns_scopes) {
DnsScopeMatch match;
LIST_FOREACH(scopes, s, q->manager->dns_scopes) {
DnsScopeMatch match;
- match = dns_scope_good_domain(s, name);
+ match = dns_scope_good_domain(s,
q->ifindex, q->flags,
name);
if (match < 0)
return match;
if (match < 0)
return match;
@@
-263,7
+265,7
@@
int dns_query_go(DnsQuery *q) {
LIST_FOREACH(scopes, s, first->scopes_next) {
DnsScopeMatch match;
LIST_FOREACH(scopes, s, first->scopes_next) {
DnsScopeMatch match;
- match = dns_scope_good_domain(s, name);
+ match = dns_scope_good_domain(s,
q->ifindex, q->flags,
name);
if (match < 0)
goto fail;
if (match < 0)
goto fail;
@@
-278,6
+280,8
@@
int dns_query_go(DnsQuery *q) {
q->answer = dns_answer_unref(q->answer);
q->answer_ifindex = 0;
q->answer_rcode = 0;
q->answer = dns_answer_unref(q->answer);
q->answer_ifindex = 0;
q->answer_rcode = 0;
+ q->answer_family = AF_UNSPEC;
+ q->answer_protocol = _DNS_PROTOCOL_INVALID;
r = sd_event_add_time(
q->manager->event,
r = sd_event_add_time(
q->manager->event,
@@
-422,6
+426,8
@@
void dns_query_ready(DnsQuery *q) {
q->answer = dns_answer_ref(answer);
q->answer_rcode = rcode;
q->answer_ifindex = (scope && scope->link) ? scope->link->ifindex : 0;
q->answer = dns_answer_ref(answer);
q->answer_rcode = rcode;
q->answer_ifindex = (scope && scope->link) ? scope->link->ifindex : 0;
+ q->answer_protocol = scope ? scope->protocol : _DNS_PROTOCOL_INVALID;
+ q->answer_family = scope ? scope->family : AF_UNSPEC;
}
dns_query_complete(q, state);
}
dns_query_complete(q, state);