revert conntrack optimization, as it's broken on arm
[openwrt.git] / target / linux / generic-2.6 / patches-2.6.25 / 950-revert_conntrack_optimization.patch
1 --- linux-2.6.25/net/netfilter/nf_conntrack_core.c 2008-04-17 04:49:44.000000000 +0200
2 +++ linux-2.6.25-owrt/net/netfilter/nf_conntrack_core.c 2008-04-30 12:36:55.000000000 +0200
3 @@ -73,19 +73,15 @@
4 static u_int32_t __hash_conntrack(const struct nf_conntrack_tuple *tuple,
5 unsigned int size, unsigned int rnd)
6 {
7 - unsigned int n;
8 - u_int32_t h;
9 + unsigned int a, b;
10
11 - /* The direction must be ignored, so we hash everything up to the
12 - * destination ports (which is a multiple of 4) and treat the last
13 - * three bytes manually.
14 - */
15 - n = (sizeof(tuple->src) + sizeof(tuple->dst.u3)) / sizeof(u32);
16 - h = jhash2((u32 *)tuple, n,
17 - rnd ^ (((__force __u16)tuple->dst.u.all << 16) |
18 - tuple->dst.protonum));
19 + a = jhash2(tuple->src.u3.all, ARRAY_SIZE(tuple->src.u3.all),
20 + (tuple->src.l3num << 16) | tuple->dst.protonum);
21 + b = jhash2(tuple->dst.u3.all, ARRAY_SIZE(tuple->dst.u3.all),
22 + ((__force __u16)tuple->src.u.all << 16) |
23 + (__force __u16)tuple->dst.u.all);
24
25 - return ((u64)h * size) >> 32;
26 + return ((u64)jhash_2words(a, b, rnd) * size) >> 32;
27 }
28
29 static inline u_int32_t hash_conntrack(const struct nf_conntrack_tuple *tuple)
This page took 0.038774 seconds and 5 git commands to generate.