diff options
author | Lennart Poettering <lennart@poettering.net> | 2016-01-15 20:36:40 +0100 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2016-01-17 20:47:46 +0100 |
commit | ed9717fcbf52b0890a249b65418a95a9382de062 (patch) | |
tree | 48f93edf516755c359c487edadb329fbd51d921f /src | |
parent | c5b4f86178f2ea72d16a26452440e84e37778f8d (diff) |
resolved: check OPT RR before accepting a reply for verification of server feature level
Let's make sure we first check if the OPT was lost in the reply, before we accept a reply as successful and use it for
verifying the current feature level.
Diffstat (limited to 'src')
-rw-r--r-- | src/resolve/resolved-dns-transaction.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/resolve/resolved-dns-transaction.c b/src/resolve/resolved-dns-transaction.c index ab619e1d3b..ee055236fa 100644 --- a/src/resolve/resolved-dns-transaction.c +++ b/src/resolve/resolved-dns-transaction.c @@ -683,8 +683,6 @@ void dns_transaction_process_reply(DnsTransaction *t, DnsPacket *p) { return; } else if (DNS_PACKET_TC(p)) dns_server_packet_truncated(t->server, t->current_feature_level); - else - dns_server_packet_received(t->server, p->ipproto, t->current_feature_level, ts - t->start_usec, p->size); break; @@ -742,8 +740,12 @@ void dns_transaction_process_reply(DnsTransaction *t, DnsPacket *p) { } /* Report that the OPT RR was missing */ - if (t->server && !p->opt) - dns_server_packet_bad_opt(t->server, t->current_feature_level); + if (t->server) { + if (!p->opt) + dns_server_packet_bad_opt(t->server, t->current_feature_level); + + dns_server_packet_received(t->server, p->ipproto, t->current_feature_level, ts - t->start_usec, p->size); + } if (IN_SET(t->scope->protocol, DNS_PROTOCOL_DNS, DNS_PROTOCOL_LLMNR)) { |