From 933e6470fc22b86310364bcc34224e12c46a760e Mon Sep 17 00:00:00 2001 From: Thomas Haller Date: Tue, 12 Jan 2021 16:51:18 +0100 Subject: [PATCH] ndisc: pack structs for lndp options There is no actual change in behavior, because "struct nd_opt_hdr" as two uint8_t, so in practice this struct was always packed already. But make it explicit, because it's clear that we use these structs to set the binary message and they need a well defined (packed) memory layout. (cherry picked from commit e3c464b56cbc6c76f9d5125270dba29a10716cf3) --- src/ndisc/nm-lndp-ndisc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/ndisc/nm-lndp-ndisc.c b/src/ndisc/nm-lndp-ndisc.c index c302f3b2c1..0692e4f9a7 100644 --- a/src/ndisc/nm-lndp-ndisc.c +++ b/src/ndisc/nm-lndp-ndisc.c @@ -339,7 +339,7 @@ _ndp_msg_add_option(struct ndp_msg *msg, int len) #define NM_ND_OPT_RDNSS 25 -typedef struct { +typedef struct _nm_packed { struct nd_opt_hdr header; uint16_t reserved; uint32_t lifetime; @@ -354,7 +354,7 @@ G_STATIC_ASSERT(sizeof(NMLndpRdnssOption) == 8u); #define NM_ND_OPT_DNSSL 31 -typedef struct { +typedef struct _nm_packed { struct nd_opt_hdr header; uint16_t reserved; uint32_t lifetime;