From 93baf62a3d02ad107a92c429fc528c26a9f7b664 Mon Sep 17 00:00:00 2001 From: Amlal El Mahrouss Date: Wed, 27 Aug 2025 22:48:37 +0200 Subject: feat: netboot: Fix BootNet header structure layout Signed-off-by: Amlal El Mahrouss --- lib/bootnet.h | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'lib') diff --git a/lib/bootnet.h b/lib/bootnet.h index 8363c39..b0c3fd9 100644 --- a/lib/bootnet.h +++ b/lib/bootnet.h @@ -13,11 +13,13 @@ #define BOOTNET_NAME_LEN (256) +struct _bootnet_inet_header; + /// @brief Netboot Internet Header /// Consists of 4 magic characters, and a set of fields describing the current patch that's being /// sent (if m_preflight = 0) /// @note Can be used to patch ROMs too (if m_implies_rom = 1) -typedef struct bootnet_inet_header { +typedef struct _bootnet_inet_header { ascii_char_t m_nb1; /// magic char 1 'N' ascii_char_t m_nb2; /// magic char 2 'E' ascii_char_t m_nb3; /// magic char 3 'T' @@ -29,4 +31,7 @@ typedef struct bootnet_inet_header { uint8_t m_implies_rom; /// does it imply reprogramming? uint8_t m_preflight; /// Do we just check if this endpoint exists/is valid? uint8_t m_blob[]; -} bootnet_inet_header; +} __attribute__((packed)) bootnet_inet_header_t; + +/// @brief Alias for the BootNet pointer. +typedef bootnet_inet_header_t* bootnet_inet_header_ptr_t; -- cgit v1.2.3