resolved: remove redundant conditionalization

If all protocols are listed there's no point in having the if check.

Follow-up for 8b4198373b
This commit is contained in:
Lennart Poettering 2020-10-27 18:00:33 +01:00
parent 1ed314087f
commit 8facd1ce4f

View file

@ -1113,12 +1113,9 @@ void dns_transaction_process_reply(DnsTransaction *t, DnsPacket *p) {
if (r > 0) /* Transaction got restarted... */
return;
if (IN_SET(t->scope->protocol, DNS_PROTOCOL_DNS, DNS_PROTOCOL_LLMNR, DNS_PROTOCOL_MDNS)) {
/* When dealing with protocols other than mDNS only consider responses with
* equivalent query section to the request. For mDNS this check doesn't make
* sense, because the section 6 of RFC6762 states that "Multicast DNS responses MUST NOT
* contain any questions in the Question Section". */
/* When dealing with protocols other than mDNS only consider responses with equivalent query section
* to the request. For mDNS this check doesn't make sense, because the section 6 of RFC6762 states
* that "Multicast DNS responses MUST NOT contain any questions in the Question Section". */
if (t->scope->protocol != DNS_PROTOCOL_MDNS) {
r = dns_packet_is_reply_for(p, t->key);
if (r < 0)
@ -1149,10 +1146,8 @@ void dns_transaction_process_reply(DnsTransaction *t, DnsPacket *p) {
if (!dns_transaction_gc(t))
return;
/* Requesting additional keys might have resulted in
* this transaction to fail, since the auxiliary
* request failed for some reason. If so, we are not
* in pending state anymore, and we should exit
/* Requesting additional keys might have resulted in this transaction to fail, since the auxiliary
* request failed for some reason. If so, we are not in pending state anymore, and we should exit
* quickly. */
if (t->state != DNS_TRANSACTION_PENDING)
return;
@ -1165,7 +1160,6 @@ void dns_transaction_process_reply(DnsTransaction *t, DnsPacket *p) {
dns_transaction_stop_timeout(t);
return;
}
}
dns_transaction_process_dnssec(t);
return;