diff options
author | Tom Gundersen <teg@jklm.no> | 2015-06-23 23:06:09 +0200 |
---|---|---|
committer | Tom Gundersen <teg@jklm.no> | 2015-11-27 01:35:34 +0100 |
commit | 9c5e12a4314e7192e834e1b855e5e80111e636a6 (patch) | |
tree | fc82c7ab5220ad0847ed439b44946528a327d50b /src/resolve/resolved-dns-packet.h | |
parent | dc913c9a1f243bca291d47b1a5d8e270c471d113 (diff) |
resolved: implement minimal EDNS0 support
This is a minimal implementation of RFC6891. Only default values
are used, so in reality this will be a noop.
EDNS0 support is dependent on the current server's feature level,
so appending the OPT pseudo RR is done when the packet is emitted,
rather than when it is assembled. To handle different feature
levels on retransmission, we strip off the OPT RR again after
sending the packet.
Similarly, to how we fall back to TCP if UDP fails, we fall back
to plain UDP if EDNS0 fails (but if EDNS0 ever succeeded we never
fall back again, and after a timeout we will retry EDNS0).
Diffstat (limited to 'src/resolve/resolved-dns-packet.h')
-rw-r--r-- | src/resolve/resolved-dns-packet.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/resolve/resolved-dns-packet.h b/src/resolve/resolved-dns-packet.h index ca94a208ba..385a8af796 100644 --- a/src/resolve/resolved-dns-packet.h +++ b/src/resolve/resolved-dns-packet.h @@ -162,6 +162,8 @@ int dns_packet_append_key(DnsPacket *p, const DnsResourceKey *key, size_t *start int dns_packet_append_rr(DnsPacket *p, const DnsResourceRecord *rr, size_t *start); int dns_packet_append_opt_rr(DnsPacket *p, uint16_t max_udp_size, size_t *start); +void dns_packet_truncate(DnsPacket *p, size_t sz); + int dns_packet_read(DnsPacket *p, size_t sz, const void **ret, size_t *start); int dns_packet_read_blob(DnsPacket *p, void *d, size_t sz, size_t *start); int dns_packet_read_uint8(DnsPacket *p, uint8_t *ret, size_t *start); |