diff options
-rw-r--r-- | net/netfilter/nf_conntrack_core.c | 2 | ||||
-rw-r--r-- | net/netfilter/nf_conntrack_netlink.c | 5 |
2 files changed, 3 insertions, 4 deletions
diff --git a/net/netfilter/nf_conntrack_core.c b/net/netfilter/nf_conntrack_core.c index 622d7c671cb7..233fdd2d7d21 100644 --- a/net/netfilter/nf_conntrack_core.c +++ b/net/netfilter/nf_conntrack_core.c | |||
@@ -305,9 +305,7 @@ void nf_conntrack_hash_insert(struct nf_conn *ct) | |||
305 | hash = hash_conntrack(&ct->tuplehash[IP_CT_DIR_ORIGINAL].tuple); | 305 | hash = hash_conntrack(&ct->tuplehash[IP_CT_DIR_ORIGINAL].tuple); |
306 | repl_hash = hash_conntrack(&ct->tuplehash[IP_CT_DIR_REPLY].tuple); | 306 | repl_hash = hash_conntrack(&ct->tuplehash[IP_CT_DIR_REPLY].tuple); |
307 | 307 | ||
308 | spin_lock_bh(&nf_conntrack_lock); | ||
309 | __nf_conntrack_hash_insert(ct, hash, repl_hash); | 308 | __nf_conntrack_hash_insert(ct, hash, repl_hash); |
310 | spin_unlock_bh(&nf_conntrack_lock); | ||
311 | } | 309 | } |
312 | EXPORT_SYMBOL_GPL(nf_conntrack_hash_insert); | 310 | EXPORT_SYMBOL_GPL(nf_conntrack_hash_insert); |
313 | 311 | ||
diff --git a/net/netfilter/nf_conntrack_netlink.c b/net/netfilter/nf_conntrack_netlink.c index a040d46f85d6..3b009a3e8549 100644 --- a/net/netfilter/nf_conntrack_netlink.c +++ b/net/netfilter/nf_conntrack_netlink.c | |||
@@ -1090,7 +1090,7 @@ ctnetlink_create_conntrack(struct nlattr *cda[], | |||
1090 | struct nf_conn_help *help; | 1090 | struct nf_conn_help *help; |
1091 | struct nf_conntrack_helper *helper; | 1091 | struct nf_conntrack_helper *helper; |
1092 | 1092 | ||
1093 | ct = nf_conntrack_alloc(&init_net, otuple, rtuple, GFP_KERNEL); | 1093 | ct = nf_conntrack_alloc(&init_net, otuple, rtuple, GFP_ATOMIC); |
1094 | if (ct == NULL || IS_ERR(ct)) | 1094 | if (ct == NULL || IS_ERR(ct)) |
1095 | return -ENOMEM; | 1095 | return -ENOMEM; |
1096 | 1096 | ||
@@ -1212,13 +1212,14 @@ ctnetlink_new_conntrack(struct sock *ctnl, struct sk_buff *skb, | |||
1212 | atomic_inc(&master_ct->ct_general.use); | 1212 | atomic_inc(&master_ct->ct_general.use); |
1213 | } | 1213 | } |
1214 | 1214 | ||
1215 | spin_unlock_bh(&nf_conntrack_lock); | ||
1216 | err = -ENOENT; | 1215 | err = -ENOENT; |
1217 | if (nlh->nlmsg_flags & NLM_F_CREATE) | 1216 | if (nlh->nlmsg_flags & NLM_F_CREATE) |
1218 | err = ctnetlink_create_conntrack(cda, | 1217 | err = ctnetlink_create_conntrack(cda, |
1219 | &otuple, | 1218 | &otuple, |
1220 | &rtuple, | 1219 | &rtuple, |
1221 | master_ct); | 1220 | master_ct); |
1221 | spin_unlock_bh(&nf_conntrack_lock); | ||
1222 | |||
1222 | if (err < 0 && master_ct) | 1223 | if (err < 0 && master_ct) |
1223 | nf_ct_put(master_ct); | 1224 | nf_ct_put(master_ct); |
1224 | 1225 | ||