struct nf_conncount_data {
unsigned int keylen;
+ u32 initval;
struct rb_root root[CONNCOUNT_SLOTS];
struct net *net;
struct work_struct gc_work;
unsigned int gc_tree;
};
-static u_int32_t conncount_rnd __read_mostly;
static struct kmem_cache *conncount_rb_cachep __read_mostly;
static struct kmem_cache *conncount_conn_cachep __read_mostly;
struct nf_conncount_rb *rbconn;
unsigned int hash;
- hash = jhash2(key, data->keylen, conncount_rnd) % CONNCOUNT_SLOTS;
+ hash = jhash2(key, data->keylen, data->initval) % CONNCOUNT_SLOTS;
root = &data->root[hash];
parent = rcu_dereference_raw(root->rb_node);
keylen == 0)
return ERR_PTR(-EINVAL);
- net_get_random_once(&conncount_rnd, sizeof(conncount_rnd));
-
data = kmalloc_obj(*data);
if (!data)
return ERR_PTR(-ENOMEM);
data->keylen = keylen / sizeof(u32);
data->net = net;
+ data->initval = get_random_u32();
INIT_WORK(&data->gc_work, tree_gc_worker);
return data;