diff options
author | Changli Gao <xiaosuo@gmail.com> | 2011-01-05 04:23:23 +0000 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2011-01-06 11:22:20 -0800 |
commit | f682cefa5ad204d3bfaa54a58046c66d2d035ac1 (patch) | |
tree | 8c55a0b722df666bb0a75f5749c7457cd5d44f3b /include/net/netfilter | |
parent | 6623e3b24a5ebb07e81648c478d286a1329ab891 (diff) | |
download | blackbird-op-linux-f682cefa5ad204d3bfaa54a58046c66d2d035ac1.tar.gz blackbird-op-linux-f682cefa5ad204d3bfaa54a58046c66d2d035ac1.zip |
netfilter: fix the race when initializing nf_ct_expect_hash_rnd
Since nf_ct_expect_dst_hash() may be called without nf_conntrack_lock
locked, nf_ct_expect_hash_rnd should be initialized in the atomic way.
In this patch, we use nf_conntrack_hash_rnd instead of
nf_ct_expect_hash_rnd.
Signed-off-by: Changli Gao <xiaosuo@gmail.com>
Acked-by: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/net/netfilter')
-rw-r--r-- | include/net/netfilter/nf_conntrack.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/include/net/netfilter/nf_conntrack.h b/include/net/netfilter/nf_conntrack.h index caf17db87dbc..d85cff10e169 100644 --- a/include/net/netfilter/nf_conntrack.h +++ b/include/net/netfilter/nf_conntrack.h @@ -298,6 +298,8 @@ static inline int nf_ct_is_untracked(const struct nf_conn *ct) extern int nf_conntrack_set_hashsize(const char *val, struct kernel_param *kp); extern unsigned int nf_conntrack_htable_size; extern unsigned int nf_conntrack_max; +extern unsigned int nf_conntrack_hash_rnd; +void init_nf_conntrack_hash_rnd(void); #define NF_CT_STAT_INC(net, count) \ __this_cpu_inc((net)->ct.stat->count) |