Re: [PATCH] netfilter: save the hash of the tuple in the original direction for latter use

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Eric Dumazet
Date: Tuesday, August 17, 2010 - 1:30 am

Le mardi 17 août 2010 à 15:16 +0800, Changli Gao a écrit :

Three variables ?

static atomic_t rnd __read_mostly;

if (unlikely(!atomic_read(&rnd))) {
	unsigned int val;

	get_random_bytes(&val, sizeof(val));
	if (!val)
		val = 1;
	atomic_cmpxchg(&rnd, 0, val);
}


--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
Re: [PATCH] netfilter: save the hash of the tuple in the o ..., Eric Dumazet, (Tue Aug 17, 1:30 am)
Re: [PATCH] netfilter: save the hash of the tuple in the o ..., Mathieu Desnoyers, (Thu Aug 19, 5:35 am)