summaryrefslogtreecommitdiff
path: root/src/resolve/resolved-dns-packet.h
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2014-07-16 18:04:14 +0200
committerLennart Poettering <lennart@poettering.net>2014-07-16 18:04:14 +0200
commitc73ce96b569e2f10dff64b7dc0bd271972674c2a (patch)
tree2b1f464ae35e99a5954fccea5efb25512c0c53c4 /src/resolve/resolved-dns-packet.h
parent3cb10d3a0b1b6a7c44f307f2abb5215104e16941 (diff)
dns-packet: allow dynamic resizing of DNS packets
Diffstat (limited to 'src/resolve/resolved-dns-packet.h')
-rw-r--r--src/resolve/resolved-dns-packet.h7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/resolve/resolved-dns-packet.h b/src/resolve/resolved-dns-packet.h
index 77edc05a19..10f8f96915 100644
--- a/src/resolve/resolved-dns-packet.h
+++ b/src/resolve/resolved-dns-packet.h
@@ -41,14 +41,19 @@ struct DnsPacketHeader {
};
#define DNS_PACKET_HEADER_SIZE sizeof(DnsPacketHeader)
+
+/* The various DNS protocols deviate in how large a packet can grow,
+ but the TCP transport has a 16bit size field, hence that appears to
+ be the maximum. */
+#define DNS_PACKET_SIZE_MAX 0xFFFF
#define DNS_PACKET_SIZE_START 512
struct DnsPacket {
int n_ref;
+ int ifindex;
size_t size, allocated, rindex;
Hashmap *names; /* For name compression */
void *data;
- int ifindex;
};
static inline uint8_t* DNS_PACKET_DATA(DnsPacket *p) {