Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 14634
b: refs/heads/master
c: 00cb277
h: refs/heads/master
v: v3
  • Loading branch information
Pablo Neira Ayuso authored and David S. Miller committed Nov 22, 2005
1 parent ca34438 commit d547858
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 13 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: 0ff60a45678e67b2547256a636fd00c1667ce4fa
refs/heads/master: 00cb277a4a1fb76aafb2fb28aa99f30546e619c5
24 changes: 12 additions & 12 deletions trunk/net/ipv4/netfilter/ip_conntrack_netlink.c
Original file line number Diff line number Diff line change
Expand Up @@ -59,11 +59,13 @@ ctnetlink_dump_tuples_proto(struct sk_buff *skb,

NFA_PUT(skb, CTA_PROTO_NUM, sizeof(u_int8_t), &tuple->dst.protonum);

/* If no protocol helper is found, this function will return the
* generic protocol helper, so proto won't *ever* be NULL */
proto = ip_conntrack_proto_find_get(tuple->dst.protonum);
if (likely(proto && proto->tuple_to_nfattr)) {
if (likely(proto->tuple_to_nfattr))
ret = proto->tuple_to_nfattr(skb, tuple);
ip_conntrack_proto_put(proto);
}

ip_conntrack_proto_put(proto);

return ret;

Expand Down Expand Up @@ -128,9 +130,11 @@ ctnetlink_dump_protoinfo(struct sk_buff *skb, const struct ip_conntrack *ct)

struct nfattr *nest_proto;
int ret;

if (!proto || !proto->to_nfattr)

if (!proto->to_nfattr) {
ip_conntrack_proto_put(proto);
return 0;
}

nest_proto = NFA_NEST(skb, CTA_PROTOINFO);

Expand Down Expand Up @@ -527,10 +531,10 @@ ctnetlink_parse_tuple_proto(struct nfattr *attr,

proto = ip_conntrack_proto_find_get(tuple->dst.protonum);

if (likely(proto && proto->nfattr_to_tuple)) {
if (likely(proto->nfattr_to_tuple))
ret = proto->nfattr_to_tuple(tb, tuple);
ip_conntrack_proto_put(proto);
}

ip_conntrack_proto_put(proto);

return ret;
}
Expand Down Expand Up @@ -596,8 +600,6 @@ static int ctnetlink_parse_nat_proto(struct nfattr *attr,
return -EINVAL;

npt = ip_nat_proto_find_get(ct->tuplehash[IP_CT_DIR_ORIGINAL].tuple.dst.protonum);
if (!npt)
return 0;

if (!npt->nfattr_to_range) {
ip_nat_proto_put(npt);
Expand Down Expand Up @@ -957,8 +959,6 @@ ctnetlink_change_protoinfo(struct ip_conntrack *ct, struct nfattr *cda[])
nfattr_parse_nested(tb, CTA_PROTOINFO_MAX, attr);

proto = ip_conntrack_proto_find_get(npt);
if (!proto)
return -EINVAL;

if (proto->from_nfattr)
err = proto->from_nfattr(tb, ct);
Expand Down

0 comments on commit d547858

Please sign in to comment.