From ede1e851604bb55db4cc29f56ae9520c5d1ec727 Mon Sep 17 00:00:00 2001 From: Ulrich Weigand Date: Mon, 2 Sep 2019 21:25:12 +0200 Subject: [PATCH] msg: Fix incorrect use of __le16/32/64 Use ceph_le16/32/64 instead of __le16/32/64 (which are no-op outside of kernel code). Fixes (partially): https://tracker.ceph.com/issues/41605 Signed-off-by: Ulrich Weigand --- src/msg/async/frames_v2.h | 8 ++++---- src/msg/msg_types.h | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/msg/async/frames_v2.h b/src/msg/async/frames_v2.h index 2abce8ae0dd..21535cabe1b 100644 --- a/src/msg/async/frames_v2.h +++ b/src/msg/async/frames_v2.h @@ -62,8 +62,8 @@ struct segment_t { static constexpr __le16 DEFAULT_ALIGNMENT = sizeof(void *); - __le32 length; - __le16 alignment; + ceph_le32 length; + ceph_le16 alignment; } __attribute__((packed)); struct SegmentIndex { @@ -102,7 +102,7 @@ struct preamble_block_t { __u8 _reserved[2]; // CRC32 for this single preamble block. - __le32 crc; + ceph_le32 crc; } __attribute__((packed)); static_assert(sizeof(preamble_block_t) % CRYPTO_BLOCK_SIZE == 0); static_assert(std::is_standard_layout::value); @@ -128,7 +128,7 @@ static_assert(std::is_standard_layout::value); // frame abortion facility. struct epilogue_plain_block_t { __u8 late_flags; - std::array<__le32, MAX_NUM_SEGMENTS> crc_values; + std::array crc_values; } __attribute__((packed)); static_assert(std::is_standard_layout::value); diff --git a/src/msg/msg_types.h b/src/msg/msg_types.h index 68434455d9a..3016d2c53fc 100644 --- a/src/msg/msg_types.h +++ b/src/msg/msg_types.h @@ -154,8 +154,8 @@ namespace std { // define a wire format for sockaddr that matches Linux's. struct ceph_sockaddr_storage { - __le16 ss_family; - __u8 __ss_padding[128 - sizeof(__le16)]; + ceph_le16 ss_family; + __u8 __ss_padding[128 - sizeof(ceph_le16)]; void encode(ceph::buffer::list& bl) const { struct ceph_sockaddr_storage ss = *this; -- 2.39.5