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 e3c464b56c)
This commit is contained in:
Thomas Haller 2021-01-12 16:51:18 +01:00
parent dc0d4ec817
commit 933e6470fc
No known key found for this signature in database
GPG key ID: 29C2366E4DFC5728

View file

@ -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;