diff options
author | Jussi Mäki <joamaki@gmail.com> | 2009-08-06 21:38:14 +0000 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2009-08-09 21:45:31 -0700 |
commit | b79a79471bd31d737c939a6ddc347417047b4320 (patch) | |
tree | c208fa8937da25184215504c063e032822ea2d3e /net | |
parent | 082ba88a5e6b1425abed3fae4ad65e0e985ed081 (diff) | |
download | kernel_samsung_smdk4412-b79a79471bd31d737c939a6ddc347417047b4320.tar.gz kernel_samsung_smdk4412-b79a79471bd31d737c939a6ddc347417047b4320.tar.bz2 kernel_samsung_smdk4412-b79a79471bd31d737c939a6ddc347417047b4320.zip |
Fix xfrm hash collisions by changing __xfrm4_daddr_saddr_hash to hash addresses with addition
This patch fixes hash collisions in cases where number
of entries have incrementing IP source and destination addresses
from single respective subnets (i.e. 192.168.0.1-172.16.0.1,
192.168.0.2-172.16.0.2, and so on.).
Signed-off-by: Jussi Maki <joamaki@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net')
-rw-r--r-- | net/xfrm/xfrm_hash.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/net/xfrm/xfrm_hash.h b/net/xfrm/xfrm_hash.h index d401dc8f05e..e5195c99f71 100644 --- a/net/xfrm/xfrm_hash.h +++ b/net/xfrm/xfrm_hash.h @@ -16,7 +16,7 @@ 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); + return ntohl(daddr->a4 + saddr->a4); } static inline unsigned int __xfrm6_daddr_saddr_hash(xfrm_address_t *daddr, xfrm_address_t *saddr) |