Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 108842
b: refs/heads/master
c: 1575e7e
h: refs/heads/master
v: v3
  • Loading branch information
Pablo Neira Ayuso authored and David S. Miller committed Aug 19, 2008
1 parent 5d3fd77 commit 77f67d0
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 16 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 46faec9858e8943226464dac50e205bf210d9174
refs/heads/master: 1575e7ea018fec992b94a12a1a491ce693ae9eac
34 changes: 19 additions & 15 deletions trunk/net/netfilter/nf_conntrack_netlink.c
Original file line number Diff line number Diff line change
Expand Up @@ -1136,16 +1136,33 @@ ctnetlink_create_conntrack(struct nlattr *cda[],
ct->timeout.expires = jiffies + ct->timeout.expires * HZ;
ct->status |= IPS_CONFIRMED;

rcu_read_lock();
helper = __nf_ct_helper_find(rtuple);
if (helper) {
help = nf_ct_helper_ext_add(ct, GFP_KERNEL);
if (help == NULL) {
rcu_read_unlock();
err = -ENOMEM;
goto err;
}
/* not in hash table yet so not strictly necessary */
rcu_assign_pointer(help->helper, helper);
}

if (cda[CTA_STATUS]) {
err = ctnetlink_change_status(ct, cda);
if (err < 0)
if (err < 0) {
rcu_read_unlock();
goto err;
}
}

if (cda[CTA_PROTOINFO]) {
err = ctnetlink_change_protoinfo(ct, cda);
if (err < 0)
if (err < 0) {
rcu_read_unlock();
goto err;
}
}

nf_ct_acct_ext_add(ct, GFP_KERNEL);
Expand All @@ -1155,19 +1172,6 @@ ctnetlink_create_conntrack(struct nlattr *cda[],
ct->mark = ntohl(nla_get_be32(cda[CTA_MARK]));
#endif

rcu_read_lock();
helper = __nf_ct_helper_find(rtuple);
if (helper) {
help = nf_ct_helper_ext_add(ct, GFP_KERNEL);
if (help == NULL) {
rcu_read_unlock();
err = -ENOMEM;
goto err;
}
/* not in hash table yet so not strictly necessary */
rcu_assign_pointer(help->helper, helper);
}

/* setup master conntrack: this is a confirmed expectation */
if (master_ct) {
__set_bit(IPS_EXPECTED_BIT, &ct->status);
Expand Down

0 comments on commit 77f67d0

Please sign in to comment.