summaryrefslogtreecommitdiffstats
path: root/src/resolve/resolved-dns-server.h
diff options
context:
space:
mode:
authorTom Gundersen <teg@jklm.no>2015-07-06 16:48:24 +0200
committerTom Gundersen <teg@jklm.no>2015-11-27 01:35:47 +0100
commitd74fb368b18f0fbd9a4fe6f15691bbea7f3c4a01 (patch)
treed7f2e66d4b67420d6c9bd0dfd399492254b4fd14 /src/resolve/resolved-dns-server.h
parentresolved: set the DNSSEC OK (DO) flag (diff)
downloadsystemd-d74fb368b18f0fbd9a4fe6f15691bbea7f3c4a01.tar.xz
systemd-d74fb368b18f0fbd9a4fe6f15691bbea7f3c4a01.zip
resolved: announce support for large UDP packets
This is often needed for proper DNSSEC support, and even to handle AAAA records without falling back to TCP. If the path between the client and server is fully compliant, this should always work, however, that is not the case, and overlarge packets will get mysteriously lost in some cases. For that reason, we use a similar fallback mechanism as we do for palin EDNS0, EDNS0+DO, etc.: The large UDP size feature is different from the other supported feature, as we cannot simply verify that it works based on receiving a reply (as the server will usually send us much smaller packets than what we claim to support, so simply receiving a reply does not mean much). For that reason, we keep track of the largest UDP packet we ever received, as this is the smallest known good size (defaulting to the standard 512 bytes). If announcing the default large size of 4096 fails (in the same way as the other features), we fall back to the known good size. The same logic of retrying after a grace-period applies.
Diffstat (limited to 'src/resolve/resolved-dns-server.h')
-rw-r--r--src/resolve/resolved-dns-server.h4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/resolve/resolved-dns-server.h b/src/resolve/resolved-dns-server.h
index 9dd4961d5f..00366a48c9 100644
--- a/src/resolve/resolved-dns-server.h
+++ b/src/resolve/resolved-dns-server.h
@@ -36,6 +36,7 @@ typedef enum DnsServerFeatureLevel {
DNS_SERVER_FEATURE_LEVEL_UDP,
DNS_SERVER_FEATURE_LEVEL_EDNS0,
DNS_SERVER_FEATURE_LEVEL_DO,
+ DNS_SERVER_FEATURE_LEVEL_LARGE,
_DNS_SERVER_FEATURE_LEVEL_MAX,
_DNS_SERVER_FEATURE_LEVEL_INVALID = -1
} DnsServerFeatureLevel;
@@ -66,6 +67,7 @@ struct DnsServer {
bool marked:1;
DnsServerFeatureLevel verified_features;
DnsServerFeatureLevel possible_features;
+ size_t received_udp_packet_max;
unsigned n_failed_attempts;
usec_t verified_usec;
usec_t features_grace_period_usec;
@@ -89,7 +91,7 @@ DnsServer* dns_server_unref(DnsServer *s);
void dns_server_unlink(DnsServer *s);
void dns_server_move_back_and_unmark(DnsServer *s);
-void dns_server_packet_received(DnsServer *s, DnsServerFeatureLevel features, usec_t rtt);
+void dns_server_packet_received(DnsServer *s, DnsServerFeatureLevel features, usec_t rtt, size_t size);
void dns_server_packet_lost(DnsServer *s, DnsServerFeatureLevel features, usec_t usec);
void dns_server_packet_failed(DnsServer *s, DnsServerFeatureLevel features);