提交 9c5ff5f7 编写于 作者: V Vlad Yasevich 提交者: David S. Miller

sctp: Fix crc32c calculations on big-endian arhes.

crc32c algorithm provides a byteswaped result.  On little-endian
arches, the result ends up in big-endian/network byte order.
On big-endinan arches, the result ends up in little-endian
order and needs to be byte swapped again.  Thus calling cpu_to_le32
gives the right output.
Tested-by: NJukka Taimisto <jukka.taimisto@mail.suomi.net>
Signed-off-by: NVlad Yasevich <vladislav.yasevich@hp.com>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 c64d2a9a
...@@ -79,5 +79,5 @@ static inline __be32 sctp_update_cksum(__u8 *buffer, __u16 length, __be32 crc32) ...@@ -79,5 +79,5 @@ static inline __be32 sctp_update_cksum(__u8 *buffer, __u16 length, __be32 crc32)
static inline __be32 sctp_end_cksum(__be32 crc32) static inline __be32 sctp_end_cksum(__be32 crc32)
{ {
return ~crc32; return (__force __be32)~cpu_to_le32((__force u32)crc32);
} }
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册