[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20150309222105.GA12158@gondor.apana.org.au>
Date: Tue, 10 Mar 2015 09:21:05 +1100
From: Herbert Xu <herbert@...dor.apana.org.au>
To: Daniel Borkmann <daniel@...earbox.net>
Cc: David Miller <davem@...emloft.net>, tgraf@...g.ch,
netdev@...r.kernel.org
Subject: Re: rhashtable: Move hash_rnd into bucket_table
On Mon, Mar 09, 2015 at 05:26:52PM +0100, Daniel Borkmann wrote:
>
> I believe the original purpose was to have reproduceability, but
> yeah, there are no users of it currently.
If anyone ever needed that we could always provide a way to set
the random value, through a rehash.
> Have you tested this patch? ;-)
Clearly not :)
> If I see this correctly, the first time you shrink or expand, your hash_rnd
> from then onwards will constantly be 0.
>
> You need to copy over the above old hash_rnd to the new one from the newly
> allocated tbl. So, bucket_table_alloc() needs a change as well. Of course,
> with rehashing, the get_random_bytes() would directly move there.
Yes it should copy them. I've fixed in my tree now and it actually
works!
Cheers,
--
Email: Herbert Xu <herbert@...dor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists