-
-
Notifications
You must be signed in to change notification settings - Fork 104
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
resolved: if one transaction completes, expect other transactions wit…
…hin candidate to succeed quickly Fixes #22575, as suggested by poettering in #35514. Intended as a workaround for some buggy routers, which refuse to send empty replies. If systemd-resolved starts two DnsTransactions, one for A and one for AAAA, and the domain in question has no AAAA entry, then the server will send a reply for A and no reply for AAAA. Correct behavior for the server would be to send an empty reply for AAAA. systemd-resolved would previously keep retrying the AAAA transaction, and eventually timeout the whole query, returning an error to the caller. Now, if the server replies to one query and not another, we cut short the timeout and return the partial result. Returning the partial result allows the rest of the system to keep working. It matches how e.g. glibc libnss_dns behaves. (cherry picked from commit 0da73fab56506ff1e4f8e59c167d27961f0fbf33) (cherry picked from commit 1748265915e09120d75766baaa4516b2779140eb) (cherry picked from commit e65fd8eb4b559ba621e2bd802894105ac1d575da) (cherry picked from commit 3761ffa) (cherry picked from commit 615ab02)
- Loading branch information
1 parent
75ec2e5
commit a019470
Showing
6 changed files
with
88 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
/* SPDX-License-Identifier: LGPL-2.1-or-later */ | ||
#pragma once | ||
|
||
#include "time-util.h" | ||
#include "resolved-def.h" | ||
|
||
/* LLMNR Jitter interval, see RFC 4795 Section 7 */ | ||
#define LLMNR_JITTER_INTERVAL_USEC (100 * USEC_PER_MSEC) | ||
|
||
/* mDNS probing interval, see RFC 6762 Section 8.1 */ | ||
#define MDNS_PROBING_INTERVAL_USEC (250 * USEC_PER_MSEC) | ||
|
||
/* Maximum attempts to send DNS requests, across all DNS servers */ | ||
#define DNS_TRANSACTION_ATTEMPTS_MAX 24 | ||
|
||
/* Maximum attempts to send LLMNR requests, see RFC 4795 Section 2.7 */ | ||
#define LLMNR_TRANSACTION_ATTEMPTS_MAX 3 | ||
|
||
/* Maximum attempts to send MDNS requests, see RFC 6762 Section 8.1 */ | ||
#define MDNS_TRANSACTION_ATTEMPTS_MAX 3 | ||
|
||
#define TRANSACTION_ATTEMPTS_MAX(p) (\ | ||
(p) == DNS_PROTOCOL_LLMNR ? \ | ||
LLMNR_TRANSACTION_ATTEMPTS_MAX : \ | ||
(p) == DNS_PROTOCOL_MDNS ? \ | ||
MDNS_TRANSACTION_ATTEMPTS_MAX : \ | ||
DNS_TRANSACTION_ATTEMPTS_MAX) | ||
|
||
/* After how much time to repeat classic DNS requests */ | ||
#define TRANSACTION_UDP_TIMEOUT_USEC (SD_RESOLVED_QUERY_TIMEOUT_USEC / DNS_TRANSACTION_ATTEMPTS_MAX) | ||
|
||
/* When we do TCP, grant a much longer timeout, as in this case there's no need for us to quickly | ||
* resend, as the kernel does that anyway for us, and we really don't want to interrupt it in that | ||
* needlessly. */ | ||
#define TRANSACTION_TCP_TIMEOUT_USEC (10 * USEC_PER_SEC) | ||
|
||
/* Should be longer than transaction timeout for a single UDP transaction, so we get at least | ||
* one transaction retry before timeouting the whole candidate */ | ||
#define CANDIDATE_EXPEDITED_TIMEOUT_USEC (TRANSACTION_UDP_TIMEOUT_USEC + 1 * USEC_PER_SEC) |