aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHannes Frederic Sowa <hannes@stressinduktion.org>2013-10-23 11:06:57 +0200
committerAlex Shi <alex.shi@linaro.org>2015-12-01 14:55:03 +0800
commita3e18ff4ff6c0a894beaf0b5caa5ad695580ea6b (patch)
tree146b4f4f65e04cb73e52e3947eb9d99f59b5f679
parentdd7c8a15b3678765a10bf57cd76eeb2387306e9e (diff)
inet: remove old fragmentation hash initializing
All fragmentation hash secrets now get initialized by their corresponding hash function with net_get_random_once. Thus we can eliminate the initial seeding. Also provide a comment that hash secret seeding happens at the first call to the corresponding hashing function. Cc: David S. Miller <davem@davemloft.net> Cc: Eric Dumazet <edumazet@google.com> Signed-off-by: Hannes Frederic Sowa <hannes@stressinduktion.org> Signed-off-by: David S. Miller <davem@davemloft.net> (cherry picked from commit 7088ad74e6e710d0c80ea2cead9500f47a2a5d58) Signed-off-by: Alex Shi <alex.shi@linaro.org>
-rw-r--r--include/net/inet_frag.h4
-rw-r--r--net/ipv4/inet_fragment.c3
2 files changed, 4 insertions, 3 deletions
diff --git a/include/net/inet_frag.h b/include/net/inet_frag.h
index 1178b3546d26..9fe644d1a26e 100644
--- a/include/net/inet_frag.h
+++ b/include/net/inet_frag.h
@@ -64,6 +64,10 @@ struct inet_frags {
rwlock_t lock ____cacheline_aligned_in_smp;
int secret_interval;
struct timer_list secret_timer;
+
+ /* The first call to hashfn is responsible to initialize
+ * rnd. This is best done with net_get_random_once.
+ */
u32 rnd;
int qsize;
diff --git a/net/ipv4/inet_fragment.c b/net/ipv4/inet_fragment.c
index 7458c7ff8a8c..535636017534 100644
--- a/net/ipv4/inet_fragment.c
+++ b/net/ipv4/inet_fragment.c
@@ -101,9 +101,6 @@ void inet_frags_init(struct inet_frags *f)
}
rwlock_init(&f->lock);
- f->rnd = (u32) ((totalram_pages ^ (totalram_pages >> 7)) ^
- (jiffies ^ (jiffies >> 6)));
-
setup_timer(&f->secret_timer, inet_frag_secret_rebuild,
(unsigned long)f);
f->secret_timer.expires = jiffies + f->secret_interval;