diff options
author | Eric Dumazet <eric.dumazet@gmail.com> | 2010-04-21 06:06:52 +0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2010-04-21 06:06:52 +0400 |
commit | 0eae88f31ca2b88911ce843452054139e028771f (patch) | |
tree | 90f50197d8e1e50e3621e9c525bd4ca2634fe368 /net/xfrm | |
parent | cb903bf4ee2d6e53210e2174d363e10698112042 (diff) | |
download | linux-0eae88f31ca2b88911ce843452054139e028771f.tar.xz |
net: Fix various endianness glitches
Sparse can help us find endianness bugs, but we need to make some
cleanups to be able to more easily spot real bugs.
Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/xfrm')
-rw-r--r-- | net/xfrm/xfrm_hash.h | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/net/xfrm/xfrm_hash.h b/net/xfrm/xfrm_hash.h index e5195c99f71e..1396572d2ade 100644 --- a/net/xfrm/xfrm_hash.h +++ b/net/xfrm/xfrm_hash.h @@ -16,7 +16,8 @@ static inline unsigned int __xfrm6_addr_hash(xfrm_address_t *addr) static inline unsigned int __xfrm4_daddr_saddr_hash(xfrm_address_t *daddr, xfrm_address_t *saddr) { - return ntohl(daddr->a4 + saddr->a4); + u32 sum = (__force u32)daddr->a4 + (__force u32)saddr->a4; + return ntohl((__force __be32)sum); } static inline unsigned int __xfrm6_daddr_saddr_hash(xfrm_address_t *daddr, xfrm_address_t *saddr) |