Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 135502
b: refs/heads/master
c: cd91566
h: refs/heads/master
v: v3
  • Loading branch information
Florian Westphal authored and Patrick McHardy committed Mar 18, 2009
1 parent 693f92b commit 17aef0b
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 7 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: 0269ea4937343536ec7e85649932bc8c9686ea78
refs/heads/master: cd91566e4bdbcb8841385e4b2eacc8d0c29c9208
15 changes: 9 additions & 6 deletions trunk/net/netfilter/nf_conntrack_netlink.c
Original file line number Diff line number Diff line change
Expand Up @@ -599,7 +599,8 @@ ctnetlink_parse_tuple_ip(struct nlattr *attr, struct nf_conntrack_tuple *tuple)

nla_parse_nested(tb, CTA_IP_MAX, attr, NULL);

l3proto = nf_ct_l3proto_find_get(tuple->src.l3num);
rcu_read_lock();
l3proto = __nf_ct_l3proto_find(tuple->src.l3num);

if (likely(l3proto->nlattr_to_tuple)) {
ret = nla_validate_nested(attr, CTA_IP_MAX,
Expand All @@ -608,7 +609,7 @@ ctnetlink_parse_tuple_ip(struct nlattr *attr, struct nf_conntrack_tuple *tuple)
ret = l3proto->nlattr_to_tuple(tb, tuple);
}

nf_ct_l3proto_put(l3proto);
rcu_read_unlock();

return ret;
}
Expand All @@ -633,7 +634,8 @@ ctnetlink_parse_tuple_proto(struct nlattr *attr,
return -EINVAL;
tuple->dst.protonum = nla_get_u8(tb[CTA_PROTO_NUM]);

l4proto = nf_ct_l4proto_find_get(tuple->src.l3num, tuple->dst.protonum);
rcu_read_lock();
l4proto = __nf_ct_l4proto_find(tuple->src.l3num, tuple->dst.protonum);

if (likely(l4proto->nlattr_to_tuple)) {
ret = nla_validate_nested(attr, CTA_PROTO_MAX,
Expand All @@ -642,7 +644,7 @@ ctnetlink_parse_tuple_proto(struct nlattr *attr,
ret = l4proto->nlattr_to_tuple(tb, tuple);
}

nf_ct_l4proto_put(l4proto);
rcu_read_unlock();

return ret;
}
Expand Down Expand Up @@ -989,10 +991,11 @@ ctnetlink_change_protoinfo(struct nf_conn *ct, struct nlattr *cda[])

nla_parse_nested(tb, CTA_PROTOINFO_MAX, attr, NULL);

l4proto = nf_ct_l4proto_find_get(nf_ct_l3num(ct), nf_ct_protonum(ct));
rcu_read_lock();
l4proto = __nf_ct_l4proto_find(nf_ct_l3num(ct), nf_ct_protonum(ct));
if (l4proto->from_nlattr)
err = l4proto->from_nlattr(tb, ct);
nf_ct_l4proto_put(l4proto);
rcu_read_unlock();

return err;
}
Expand Down

0 comments on commit 17aef0b

Please sign in to comment.