summaryrefslogtreecommitdiff
path: root/src/resolve/resolved-dns-packet.h
diff options
context:
space:
mode:
authorTom Gundersen <teg@jklm.no>2015-06-24 21:22:46 +0200
committerTom Gundersen <teg@jklm.no>2015-07-14 12:03:04 +0200
commita0166609f782da91710dea9183d1bf138538db37 (patch)
tree766e80f1d02801a548faafb98f4c4148198e51f6 /src/resolve/resolved-dns-packet.h
parentff89f8b917a83a3fc0dc3ad0961c3bc953f78e8f (diff)
resolved: packet - ensure there is space for IP+UDP headers
Currently we only make sure our links can handle the size of the payload witohut taking the headers into account.
Diffstat (limited to 'src/resolve/resolved-dns-packet.h')
-rw-r--r--src/resolve/resolved-dns-packet.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/resolve/resolved-dns-packet.h b/src/resolve/resolved-dns-packet.h
index bf998aa84e..6588ed9df5 100644
--- a/src/resolve/resolved-dns-packet.h
+++ b/src/resolve/resolved-dns-packet.h
@@ -21,6 +21,8 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
+#include <netinet/udp.h>
+#include <netinet/ip.h>
#include "macro.h"
#include "sparse-endian.h"
@@ -53,6 +55,7 @@ struct DnsPacketHeader {
};
#define DNS_PACKET_HEADER_SIZE sizeof(DnsPacketHeader)
+#define UDP_PACKET_HEADER_SIZE (sizeof(struct iphdr) + sizeof(struct udphdr))
/* 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