netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Hannes Frederic Sowa <hannes@stressinduktion.org>
To: netdev@vger.kernel.org
Cc: eric.dumazet@gmail.com, yoshfuji@linux-ipv6.org
Subject: [PATCH RFC] ipv6: use stronger hash for reassembly queue hash table
Date: Thu, 7 Mar 2013 22:42:11 +0100	[thread overview]
Message-ID: <20130307214211.GP7941@order.stressinduktion.org> (raw)

ipv6_addr_hash can yield the exact same hash value for countless ip
addresses from one /64 subnet. Let's make it a bit harder to create a
long list of reassembly queues in the hash table by using a stronger hash.

I spotted this just by looking at the source and did not verify if it
is really the case, so this patch has RFC status. But the jhash change
should not really hurt anyway. This patch is only compile tested.

Cc: Eric Dumazet <eric.dumazet@gmail.com>
Cc: YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>
Signed-off-by: Hannes Frederic Sowa <hannes@stressinduktion.org>
---
 net/ipv6/reassembly.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net/ipv6/reassembly.c b/net/ipv6/reassembly.c
index 3c6a772..4d39cf3 100644
--- a/net/ipv6/reassembly.c
+++ b/net/ipv6/reassembly.c
@@ -79,7 +79,7 @@ unsigned int inet6_hash_frag(__be32 id, const struct in6_addr *saddr,
 {
 	u32 c;
 
-	c = jhash_3words(ipv6_addr_hash(saddr), ipv6_addr_hash(daddr),
+	c = jhash_3words(ipv6_addr_jhash(saddr), ipv6_addr_hash(daddr),
 			 (__force u32)id, rnd);
 
 	return c & (INETFRAGS_HASHSZ - 1);
-- 
1.8.1.4

             reply	other threads:[~2013-03-07 21:42 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-03-07 21:42 Hannes Frederic Sowa [this message]
2013-03-08  5:57 ` [PATCH RFC] ipv6: use stronger hash for reassembly queue hash table Hannes Frederic Sowa
2013-03-08 13:04   ` Hannes Frederic Sowa
2013-03-08 14:53     ` Eric Dumazet
2013-03-08 15:08       ` Hannes Frederic Sowa
2013-03-08 15:23         ` Eric Dumazet
2013-03-08 15:54           ` Hannes Frederic Sowa
2013-03-08 16:15             ` Eric Dumazet
2013-03-08 16:18               ` Hannes Frederic Sowa
2013-03-09 15:19             ` Hannes Frederic Sowa
2013-03-08 20:53           ` Hannes Frederic Sowa
2013-03-13  1:27           ` Hannes Frederic Sowa
2013-03-13  1:31             ` Hannes Frederic Sowa
2013-03-13  5:29             ` Eric Dumazet
2013-03-14  1:37               ` Hannes Frederic Sowa
2013-03-14  4:36                 ` Stephen Hemminger
2013-03-14  7:14                   ` Hannes Frederic Sowa
2013-03-14  9:47                     ` David Laight
2013-03-14 10:34                       ` Eric Dumazet
2013-03-14 12:34                       ` Hannes Frederic Sowa
2013-03-14  7:10                 ` Jesper Dangaard Brouer
2013-03-14  7:23                   ` Hannes Frederic Sowa
2013-03-14  7:28                     ` Hannes Frederic Sowa
2013-03-14  9:18                       ` Jesper Dangaard Brouer
2013-03-14 12:45                         ` Hannes Frederic Sowa

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20130307214211.GP7941@order.stressinduktion.org \
    --to=hannes@stressinduktion.org \
    --cc=eric.dumazet@gmail.com \
    --cc=netdev@vger.kernel.org \
    --cc=yoshfuji@linux-ipv6.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).