Skip to content

Commit

Permalink
inet: remove old fragmentation hash initializing
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Hannes Frederic Sowa authored and David S. Miller committed Oct 23, 2013
1 parent b119057 commit 7088ad7
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
4 changes: 4 additions & 0 deletions include/net/inet_frag.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
3 changes: 0 additions & 3 deletions net/ipv4/inet_fragment.c
Original file line number Diff line number Diff line change
Expand Up @@ -93,9 +93,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;
Expand Down

0 comments on commit 7088ad7

Please sign in to comment.