diff options
author | Seung-Woo Kim <sw0312.kim@samsung.com> | 2018-05-31 13:11:43 +0900 |
---|---|---|
committer | Seung-Woo Kim <sw0312.kim@samsung.com> | 2018-05-31 13:11:46 +0900 |
commit | 644503bbf4cd6d429b84955feb06fb1aebc7396f (patch) | |
tree | 6560aca520f076fa638c9337799a2749ce38cfef | |
parent | 3dfe8ea6fd98f004757a85d5468455da3e281218 (diff) | |
download | lthor-644503bbf4cd6d429b84955feb06fb1aebc7396f.tar.gz lthor-644503bbf4cd6d429b84955feb06fb1aebc7396f.tar.bz2 lthor-644503bbf4cd6d429b84955feb06fb1aebc7396f.zip |
Add packed attribute to message protocol struct
The structures for message should be packed for communication. Add
explict packed attribute to the message struct.
Change-Id: I33ec2986a5caedf0dfa248b2e04c51ee75ae1520
Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com>
-rw-r--r-- | libthor/thor-proto.h | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/libthor/thor-proto.h b/libthor/thor-proto.h index b02c6d5..c4b3965 100644 --- a/libthor/thor-proto.h +++ b/libthor/thor-proto.h @@ -53,7 +53,7 @@ struct rqt_pkt { int32_t int_data[14]; /* Int. Datas. */ char str_data[5][32]; /* Str. Data. */ char md5[32]; /* MD5 Checksum. */ -}; +} __attribute__((__packed__)); struct res_pkt { @@ -62,13 +62,13 @@ struct res_pkt { int32_t ack; /* Ack. */ int32_t int_data[5]; /* Int. Datas. */ char str_data[3][32]; /* Str. Data. */ -}; +} __attribute__((__packed__)); struct data_res_pkt { int32_t ack; /* Ack. */ int32_t cnt; /* Int. Datas. */ -}; +} __attribute__((__packed__)); #define RQT_PKT_SIZE sizeof(struct rqt_pkt) |