|
@@ -1376,14 +1376,14 @@ ctnetlink_change_helper(struct nf_conn *ct, const struct nlattr * const cda[])
|
|
nf_ct_protonum(ct));
|
|
nf_ct_protonum(ct));
|
|
if (helper == NULL) {
|
|
if (helper == NULL) {
|
|
#ifdef CONFIG_MODULES
|
|
#ifdef CONFIG_MODULES
|
|
- spin_unlock_bh(&nf_conntrack_lock);
|
|
|
|
|
|
+ spin_unlock_bh(&nf_conntrack_expect_lock);
|
|
|
|
|
|
if (request_module("nfct-helper-%s", helpname) < 0) {
|
|
if (request_module("nfct-helper-%s", helpname) < 0) {
|
|
- spin_lock_bh(&nf_conntrack_lock);
|
|
|
|
|
|
+ spin_lock_bh(&nf_conntrack_expect_lock);
|
|
return -EOPNOTSUPP;
|
|
return -EOPNOTSUPP;
|
|
}
|
|
}
|
|
|
|
|
|
- spin_lock_bh(&nf_conntrack_lock);
|
|
|
|
|
|
+ spin_lock_bh(&nf_conntrack_expect_lock);
|
|
helper = __nf_conntrack_helper_find(helpname, nf_ct_l3num(ct),
|
|
helper = __nf_conntrack_helper_find(helpname, nf_ct_l3num(ct),
|
|
nf_ct_protonum(ct));
|
|
nf_ct_protonum(ct));
|
|
if (helper)
|
|
if (helper)
|
|
@@ -1821,9 +1821,9 @@ ctnetlink_new_conntrack(struct sock *ctnl, struct sk_buff *skb,
|
|
err = -EEXIST;
|
|
err = -EEXIST;
|
|
ct = nf_ct_tuplehash_to_ctrack(h);
|
|
ct = nf_ct_tuplehash_to_ctrack(h);
|
|
if (!(nlh->nlmsg_flags & NLM_F_EXCL)) {
|
|
if (!(nlh->nlmsg_flags & NLM_F_EXCL)) {
|
|
- spin_lock_bh(&nf_conntrack_lock);
|
|
|
|
|
|
+ spin_lock_bh(&nf_conntrack_expect_lock);
|
|
err = ctnetlink_change_conntrack(ct, cda);
|
|
err = ctnetlink_change_conntrack(ct, cda);
|
|
- spin_unlock_bh(&nf_conntrack_lock);
|
|
|
|
|
|
+ spin_unlock_bh(&nf_conntrack_expect_lock);
|
|
if (err == 0) {
|
|
if (err == 0) {
|
|
nf_conntrack_eventmask_report((1 << IPCT_REPLY) |
|
|
nf_conntrack_eventmask_report((1 << IPCT_REPLY) |
|
|
(1 << IPCT_ASSURED) |
|
|
(1 << IPCT_ASSURED) |
|
|
@@ -2152,9 +2152,9 @@ ctnetlink_nfqueue_parse(const struct nlattr *attr, struct nf_conn *ct)
|
|
if (ret < 0)
|
|
if (ret < 0)
|
|
return ret;
|
|
return ret;
|
|
|
|
|
|
- spin_lock_bh(&nf_conntrack_lock);
|
|
|
|
|
|
+ spin_lock_bh(&nf_conntrack_expect_lock);
|
|
ret = ctnetlink_nfqueue_parse_ct((const struct nlattr **)cda, ct);
|
|
ret = ctnetlink_nfqueue_parse_ct((const struct nlattr **)cda, ct);
|
|
- spin_unlock_bh(&nf_conntrack_lock);
|
|
|
|
|
|
+ spin_unlock_bh(&nf_conntrack_expect_lock);
|
|
|
|
|
|
return ret;
|
|
return ret;
|
|
}
|
|
}
|
|
@@ -2709,13 +2709,13 @@ ctnetlink_del_expect(struct sock *ctnl, struct sk_buff *skb,
|
|
}
|
|
}
|
|
|
|
|
|
/* after list removal, usage count == 1 */
|
|
/* after list removal, usage count == 1 */
|
|
- spin_lock_bh(&nf_conntrack_lock);
|
|
|
|
|
|
+ spin_lock_bh(&nf_conntrack_expect_lock);
|
|
if (del_timer(&exp->timeout)) {
|
|
if (del_timer(&exp->timeout)) {
|
|
nf_ct_unlink_expect_report(exp, NETLINK_CB(skb).portid,
|
|
nf_ct_unlink_expect_report(exp, NETLINK_CB(skb).portid,
|
|
nlmsg_report(nlh));
|
|
nlmsg_report(nlh));
|
|
nf_ct_expect_put(exp);
|
|
nf_ct_expect_put(exp);
|
|
}
|
|
}
|
|
- spin_unlock_bh(&nf_conntrack_lock);
|
|
|
|
|
|
+ spin_unlock_bh(&nf_conntrack_expect_lock);
|
|
/* have to put what we 'get' above.
|
|
/* have to put what we 'get' above.
|
|
* after this line usage count == 0 */
|
|
* after this line usage count == 0 */
|
|
nf_ct_expect_put(exp);
|
|
nf_ct_expect_put(exp);
|
|
@@ -2724,7 +2724,7 @@ ctnetlink_del_expect(struct sock *ctnl, struct sk_buff *skb,
|
|
struct nf_conn_help *m_help;
|
|
struct nf_conn_help *m_help;
|
|
|
|
|
|
/* delete all expectations for this helper */
|
|
/* delete all expectations for this helper */
|
|
- spin_lock_bh(&nf_conntrack_lock);
|
|
|
|
|
|
+ spin_lock_bh(&nf_conntrack_expect_lock);
|
|
for (i = 0; i < nf_ct_expect_hsize; i++) {
|
|
for (i = 0; i < nf_ct_expect_hsize; i++) {
|
|
hlist_for_each_entry_safe(exp, next,
|
|
hlist_for_each_entry_safe(exp, next,
|
|
&net->ct.expect_hash[i],
|
|
&net->ct.expect_hash[i],
|
|
@@ -2739,10 +2739,10 @@ ctnetlink_del_expect(struct sock *ctnl, struct sk_buff *skb,
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
- spin_unlock_bh(&nf_conntrack_lock);
|
|
|
|
|
|
+ spin_unlock_bh(&nf_conntrack_expect_lock);
|
|
} else {
|
|
} else {
|
|
/* This basically means we have to flush everything*/
|
|
/* This basically means we have to flush everything*/
|
|
- spin_lock_bh(&nf_conntrack_lock);
|
|
|
|
|
|
+ spin_lock_bh(&nf_conntrack_expect_lock);
|
|
for (i = 0; i < nf_ct_expect_hsize; i++) {
|
|
for (i = 0; i < nf_ct_expect_hsize; i++) {
|
|
hlist_for_each_entry_safe(exp, next,
|
|
hlist_for_each_entry_safe(exp, next,
|
|
&net->ct.expect_hash[i],
|
|
&net->ct.expect_hash[i],
|
|
@@ -2755,7 +2755,7 @@ ctnetlink_del_expect(struct sock *ctnl, struct sk_buff *skb,
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
- spin_unlock_bh(&nf_conntrack_lock);
|
|
|
|
|
|
+ spin_unlock_bh(&nf_conntrack_expect_lock);
|
|
}
|
|
}
|
|
|
|
|
|
return 0;
|
|
return 0;
|
|
@@ -2981,11 +2981,11 @@ ctnetlink_new_expect(struct sock *ctnl, struct sk_buff *skb,
|
|
if (err < 0)
|
|
if (err < 0)
|
|
return err;
|
|
return err;
|
|
|
|
|
|
- spin_lock_bh(&nf_conntrack_lock);
|
|
|
|
|
|
+ spin_lock_bh(&nf_conntrack_expect_lock);
|
|
exp = __nf_ct_expect_find(net, zone, &tuple);
|
|
exp = __nf_ct_expect_find(net, zone, &tuple);
|
|
|
|
|
|
if (!exp) {
|
|
if (!exp) {
|
|
- spin_unlock_bh(&nf_conntrack_lock);
|
|
|
|
|
|
+ spin_unlock_bh(&nf_conntrack_expect_lock);
|
|
err = -ENOENT;
|
|
err = -ENOENT;
|
|
if (nlh->nlmsg_flags & NLM_F_CREATE) {
|
|
if (nlh->nlmsg_flags & NLM_F_CREATE) {
|
|
err = ctnetlink_create_expect(net, zone, cda,
|
|
err = ctnetlink_create_expect(net, zone, cda,
|
|
@@ -2999,7 +2999,7 @@ ctnetlink_new_expect(struct sock *ctnl, struct sk_buff *skb,
|
|
err = -EEXIST;
|
|
err = -EEXIST;
|
|
if (!(nlh->nlmsg_flags & NLM_F_EXCL))
|
|
if (!(nlh->nlmsg_flags & NLM_F_EXCL))
|
|
err = ctnetlink_change_expect(exp, cda);
|
|
err = ctnetlink_change_expect(exp, cda);
|
|
- spin_unlock_bh(&nf_conntrack_lock);
|
|
|
|
|
|
+ spin_unlock_bh(&nf_conntrack_expect_lock);
|
|
|
|
|
|
return err;
|
|
return err;
|
|
}
|
|
}
|