} _packed_ eth;
struct {
/* 2 - 254: ARP/Link-Layer (RFC 2132) */
- uint8_t haddr[0];
+ uint8_t haddr[HW_ADDR_MAX_SIZE];
} _packed_ ll;
struct {
/* 255: Node-specific (RFC 4361) */
};
} sd_dhcp_client_id;
+assert_cc(sizeof_field(sd_dhcp_client_id, id) <= MAX_CLIENT_ID_LEN);
+
static inline bool client_id_size_is_valid(size_t size) {
return size >= MIN_CLIENT_ID_LEN && size <= MAX_CLIENT_ID_LEN;
}
/* DUID_TYPE_LLT */
be16_t htype;
be32_t time;
- uint8_t haddr[];
+ uint8_t haddr[HW_ADDR_MAX_SIZE];
} _packed_ llt;
struct {
/* DUID_TYPE_EN */
be32_t pen;
- uint8_t id[];
+ /* The maximum length of vendor ID is not provided in RFC 8415, but we use 8 bytes.
+ * See https://datatracker.ietf.org/doc/html/rfc8415#section-11.3 */
+ uint8_t id[8];
} _packed_ en;
struct {
/* DUID_TYPE_LL */
be16_t htype;
- uint8_t haddr[];
+ uint8_t haddr[HW_ADDR_MAX_SIZE];
} _packed_ ll;
struct {
/* DUID_TYPE_UUID */
};
} _packed_;
+assert_cc(sizeof(struct duid) == MAX_DUID_LEN);
+
typedef struct sd_dhcp_duid {
size_t size;
union {