From 2e6eca1918935d1981349bb4d2efebb02a627a85 Mon Sep 17 00:00:00 2001 From: Marian Buschsieweke Date: Thu, 4 Nov 2021 10:09:54 +0100 Subject: [PATCH] sys/net/dns: mark dns_hdr_t as packed This structure is used to parse data from unaligned buffers, so make sure the compiler issues instructions suitable for unaligned memory access. --- sys/include/net/dns/msg.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/include/net/dns/msg.h b/sys/include/net/dns/msg.h index 8faa54f4a1..98c700c747 100644 --- a/sys/include/net/dns/msg.h +++ b/sys/include/net/dns/msg.h @@ -45,7 +45,7 @@ extern "C" { * * @see [RFC 1035, section 4.1.1](https://tools.ietf.org/html/rfc1035#section-4.1.1) */ -typedef struct { +typedef struct __attribute__((packed)) { uint16_t id; /**< identifier */ /** * @brief flags