X-Git-Url: http://git.ipfire.org/?p=thirdparty%2Fsystemd.git;a=blobdiff_plain;f=src%2Fresolve%2Fresolved-dns-transaction.c;h=2ef02348064bf8cf9488a12d9b8fa2373f330869;hp=075dfac01bd09bdaad7c4abe6b1736348bc49609;hb=71a681ae50175a569bf832d2615fd11994c41d73;hpb=652ba568c6624bf40d735645f029d83d21bdeaa6 diff --git a/src/resolve/resolved-dns-transaction.c b/src/resolve/resolved-dns-transaction.c index 075dfac01bd..2ef02348064 100644 --- a/src/resolve/resolved-dns-transaction.c +++ b/src/resolve/resolved-dns-transaction.c @@ -6,6 +6,7 @@ #include "alloc-util.h" #include "dns-domain.h" #include "errno-list.h" +#include "errno-util.h" #include "fd-util.h" #include "random-util.h" #include "resolved-dns-cache.h" @@ -267,7 +268,7 @@ static void dns_transaction_tentative(DnsTransaction *t, DnsPacket *p) { t->id, dns_resource_key_to_string(t->key, key_str, sizeof key_str), dns_protocol_to_string(t->scope->protocol), - t->scope->link ? t->scope->link->name : "*", + t->scope->link ? t->scope->link->ifname : "*", af_to_name_short(t->scope->family), strnull(pretty)); @@ -332,7 +333,7 @@ void dns_transaction_complete(DnsTransaction *t, DnsTransactionState state) { t->id, dns_resource_key_to_string(t->key, key_str, sizeof key_str), dns_protocol_to_string(t->scope->protocol), - t->scope->link ? t->scope->link->name : "*", + t->scope->link ? t->scope->link->ifname : "*", af_to_name_short(t->scope->family), st, t->answer_source < 0 ? "none" : dns_transaction_source_to_string(t->answer_source), @@ -540,12 +541,8 @@ static int on_stream_packet(DnsStream *s) { if (t) return dns_transaction_on_stream_packet(t, p); - /* Ignore incorrect transaction id as transaction can have been canceled */ - if (dns_packet_validate_reply(p) <= 0) { - log_debug("Invalid TCP reply packet."); - on_stream_complete(s, 0); - } - + /* Ignore incorrect transaction id as an old transaction can have been canceled. */ + log_debug("Received unexpected TCP reply packet with id %" PRIu16 ", ignoring.", DNS_PACKET_ID(p)); return 0; } @@ -639,8 +636,8 @@ static int dns_transaction_emit_tcp(DnsTransaction *t) { if (t->server) { dns_server_unref_stream(t->server); - t->server->stream = dns_stream_ref(s); s->server = dns_server_ref(t->server); + t->server->stream = dns_stream_ref(s); } s->complete = on_stream_complete; @@ -737,7 +734,7 @@ static int dns_transaction_dnssec_ready(DnsTransaction *t) { } /* Fall-through: NXDOMAIN/SERVFAIL is good enough for us. This is because some DNS servers - * erronously return NXDOMAIN/SERVFAIL for empty non-terminals (Akamai...) or missing DS + * erroneously return NXDOMAIN/SERVFAIL for empty non-terminals (Akamai...) or missing DS * records (Facebook), and we need to handle that nicely, when asking for parent SOA or similar * RRs to make unsigned proofs. */ @@ -1505,7 +1502,7 @@ static int dns_transaction_make_packet_mdns(DnsTransaction *t) { /* * For mDNS, we want to coalesce as many open queries in pending transactions into one single * query packet on the wire as possible. To achieve that, we iterate through all pending transactions - * in our current scope, and see whether their timing contraints allow them to be sent. + * in our current scope, and see whether their timing constraints allow them to be sent. */ assert_se(sd_event_now(t->scope->manager->event, clock_boottime_or_monotonic(), &ts) >= 0); @@ -1651,7 +1648,7 @@ int dns_transaction_go(DnsTransaction *t) { t->id, dns_resource_key_to_string(t->key, key_str, sizeof key_str), dns_protocol_to_string(t->scope->protocol), - t->scope->link ? t->scope->link->name : "*", + t->scope->link ? t->scope->link->ifname : "*", af_to_name_short(t->scope->family)); if (!t->initial_jitter_scheduled && @@ -2029,7 +2026,7 @@ int dns_transaction_request_dnssec_keys(DnsTransaction *t) { if (t->answer_source != DNS_TRANSACTION_NETWORK) return 0; /* We only need to validate stuff from the network */ if (!dns_transaction_dnssec_supported(t)) - return 0; /* If we can't do DNSSEC anyway there's no point in geting the auxiliary RRs */ + return 0; /* If we can't do DNSSEC anyway there's no point in getting the auxiliary RRs */ DNS_ANSWER_FOREACH(rr, t->answer) { @@ -2069,7 +2066,7 @@ int dns_transaction_request_dnssec_keys(DnsTransaction *t) { * RRs for stuff we didn't really ask for, and * also to avoid request loops, where * additional RRs from one transaction result - * in another transaction whose additonal RRs + * in another transaction whose additional RRs * point back to the original transaction, and * we deadlock. */ r = dns_name_endswith(dns_resource_key_name(t->key), rr->rrsig.signer);