From c9dc332811b0f98799411de6cbed66957c184188 Mon Sep 17 00:00:00 2001 From: Ian Moffett Date: Thu, 25 Sep 2025 14:57:59 -0400 Subject: dgram: Put CRC32 at the end of the datagram hdr This makes it easier to compute the checksum as we can simply subtract from the length of the header Signed-off-by: Ian Moffett --- src/include/dgram.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/include/dgram.h') diff --git a/src/include/dgram.h b/src/include/dgram.h index 0f798ee..31f7c03 100644 --- a/src/include/dgram.h +++ b/src/include/dgram.h @@ -40,18 +40,18 @@ typedef tx_len_t rx_len_t; /* * Represents an ONET datagram * - * @crc32: CRC32 checksum of data + header * @length: Packet length in bytes * @reserved: Reserved for future use * @reserved1: Reserved for future use * @port: Datagram port number to send on + * @crc32: CRC32 checksum of data + header */ struct onet_dgram { - uint32_t crc32; uint16_t length; uint16_t reserved; uint16_t reserved1; uint8_t port; + uint32_t crc32; } __attribute__((packed)); /* -- cgit v1.2.3