提交 ca3d41a5 编写于 作者: A Akinobu Mita 提交者: Linus Torvalds

net/netfilter: rename random32() to prandom_u32()

Use preferable function name which implies using a pseudo-random
number generator.
Signed-off-by: NAkinobu Mita <akinobu.mita@gmail.com>
Cc: Pablo Neira Ayuso <pablo@netfilter.org>
Cc: Patrick McHardy <kaber@trash.net>
Cc: "David S. Miller" <davem@davemloft.net>
Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
上级 5106f3bd
...@@ -264,7 +264,7 @@ static void death_by_event(unsigned long ul_conntrack) ...@@ -264,7 +264,7 @@ static void death_by_event(unsigned long ul_conntrack)
if (nf_conntrack_event(IPCT_DESTROY, ct) < 0) { if (nf_conntrack_event(IPCT_DESTROY, ct) < 0) {
/* bad luck, let's retry again */ /* bad luck, let's retry again */
ecache->timeout.expires = jiffies + ecache->timeout.expires = jiffies +
(random32() % net->ct.sysctl_events_retry_timeout); (prandom_u32() % net->ct.sysctl_events_retry_timeout);
add_timer(&ecache->timeout); add_timer(&ecache->timeout);
return; return;
} }
...@@ -283,7 +283,7 @@ void nf_ct_dying_timeout(struct nf_conn *ct) ...@@ -283,7 +283,7 @@ void nf_ct_dying_timeout(struct nf_conn *ct)
/* set a new timer to retry event delivery */ /* set a new timer to retry event delivery */
setup_timer(&ecache->timeout, death_by_event, (unsigned long)ct); setup_timer(&ecache->timeout, death_by_event, (unsigned long)ct);
ecache->timeout.expires = jiffies + ecache->timeout.expires = jiffies +
(random32() % net->ct.sysctl_events_retry_timeout); (prandom_u32() % net->ct.sysctl_events_retry_timeout);
add_timer(&ecache->timeout); add_timer(&ecache->timeout);
} }
EXPORT_SYMBOL_GPL(nf_ct_dying_timeout); EXPORT_SYMBOL_GPL(nf_ct_dying_timeout);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册