diff options
author | Vlad Yasevich <vladislav.yasevich@hp.com> | 2009-01-22 17:52:23 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2009-01-22 17:52:23 -0500 |
commit | 9c5ff5f75d0d0a1c7928ecfae3f38418b51a88e3 (patch) | |
tree | 5211a9794d3d8104b19d1dd544248755f5faf076 /include/net/sctp/checksum.h | |
parent | c64d2a9afbccd0aecb122d108770a407fe7b7e3f (diff) |
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: Jukka Taimisto <jukka.taimisto@mail.suomi.net>
Signed-off-by: Vlad Yasevich <vladislav.yasevich@hp.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/net/sctp/checksum.h')
-rw-r--r-- | include/net/sctp/checksum.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/include/net/sctp/checksum.h b/include/net/sctp/checksum.h index b799fb21519a..2fec3c366e81 100644 --- a/include/net/sctp/checksum.h +++ b/include/net/sctp/checksum.h | |||
@@ -79,5 +79,5 @@ static inline __be32 sctp_update_cksum(__u8 *buffer, __u16 length, __be32 crc32) | |||
79 | 79 | ||
80 | static inline __be32 sctp_end_cksum(__be32 crc32) | 80 | static inline __be32 sctp_end_cksum(__be32 crc32) |
81 | { | 81 | { |
82 | return ~crc32; | 82 | return (__force __be32)~cpu_to_le32((__force u32)crc32); |
83 | } | 83 | } |