From d2da04cf17a0fd5819249c388c9b6403d75de59d Mon Sep 17 00:00:00 2001 From: Jeremy Compostella Date: Tue, 10 May 2016 11:53:06 +0200 Subject: libfec: pack the fec_header structure The fec_header structure is generated build time and stored on disk. The fec_header might be build on a 64 bits machine while it is read per a 32 bits device or the other way around. In such situations, the fec_header fields are not aligned as expected by the device and it fails to read the fec_header structure. This patch makes the fec_header packed. Change-Id: I77546f850cea5559909971a1192e1a7616d22d50 Signed-off-by: Jeremy Compostella --- libfec/include/fec/io.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'libfec') diff --git a/libfec/include/fec/io.h b/libfec/include/fec/io.h index 8c0759b4..42ed0975 100644 --- a/libfec/include/fec/io.h +++ b/libfec/include/fec/io.h @@ -50,7 +50,7 @@ struct fec_header { uint32_t fec_size; uint64_t inp_size; uint8_t hash[SHA256_DIGEST_LENGTH]; -}; +} __attribute__ ((packed)); struct fec_status { int flags; -- cgit v1.2.3