Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 224524
b: refs/heads/master
c: 82a39eb
h: refs/heads/master
v: v3
  • Loading branch information
Jozsef Kadlecsik authored and David S. Miller committed Nov 28, 2010
1 parent a2a47e5 commit 239357b
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 33 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: aa285b1740f5b13e5a2606a927f3129954583d78
refs/heads/master: 82a39eb6b3829a02e235656feddb4542517fcabc
22 changes: 10 additions & 12 deletions trunk/net/ipv6/inet6_connection_sock.c
Original file line number Diff line number Diff line change
Expand Up @@ -60,18 +60,16 @@ EXPORT_SYMBOL_GPL(inet6_csk_bind_conflict);
static u32 inet6_synq_hash(const struct in6_addr *raddr, const __be16 rport,
const u32 rnd, const u16 synq_hsize)
{
u32 a = (__force u32)raddr->s6_addr32[0];
u32 b = (__force u32)raddr->s6_addr32[1];
u32 c = (__force u32)raddr->s6_addr32[2];

a += JHASH_GOLDEN_RATIO;
b += JHASH_GOLDEN_RATIO;
c += rnd;
__jhash_mix(a, b, c);

a += (__force u32)raddr->s6_addr32[3];
b += (__force u32)rport;
__jhash_mix(a, b, c);
u32 c;

c = jhash_3words((__force u32)raddr->s6_addr32[0],
(__force u32)raddr->s6_addr32[1],
(__force u32)raddr->s6_addr32[2],
rnd);

c = jhash_2words((__force u32)raddr->s6_addr32[3],
(__force u32)rport,
c);

return c & (synq_hsize - 1);
}
Expand Down
36 changes: 16 additions & 20 deletions trunk/net/ipv6/reassembly.c
Original file line number Diff line number Diff line change
Expand Up @@ -104,26 +104,22 @@ static int ip6_frag_reasm(struct frag_queue *fq, struct sk_buff *prev,
unsigned int inet6_hash_frag(__be32 id, const struct in6_addr *saddr,
const struct in6_addr *daddr, u32 rnd)
{
u32 a, b, c;

a = (__force u32)saddr->s6_addr32[0];
b = (__force u32)saddr->s6_addr32[1];
c = (__force u32)saddr->s6_addr32[2];

a += JHASH_GOLDEN_RATIO;
b += JHASH_GOLDEN_RATIO;
c += rnd;
__jhash_mix(a, b, c);

a += (__force u32)saddr->s6_addr32[3];
b += (__force u32)daddr->s6_addr32[0];
c += (__force u32)daddr->s6_addr32[1];
__jhash_mix(a, b, c);

a += (__force u32)daddr->s6_addr32[2];
b += (__force u32)daddr->s6_addr32[3];
c += (__force u32)id;
__jhash_mix(a, b, c);
u32 c;

c = jhash_3words((__force u32)saddr->s6_addr32[0],
(__force u32)saddr->s6_addr32[1],
(__force u32)saddr->s6_addr32[2],
rnd);

c = jhash_3words((__force u32)saddr->s6_addr32[3],
(__force u32)daddr->s6_addr32[0],
(__force u32)daddr->s6_addr32[1],
c);

c = jhash_3words((__force u32)daddr->s6_addr32[2],
(__force u32)daddr->s6_addr32[3],
(__force u32)id,
c);

return c & (INETFRAGS_HASHSZ - 1);
}
Expand Down

0 comments on commit 239357b

Please sign in to comment.