Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 9836
b: refs/heads/master
c: 061cb4a
h: refs/heads/master
v: v3
  • Loading branch information
Pablo Neira Ayuso authored and David S. Miller committed Oct 11, 2005
1 parent 0fa6792 commit 82237d0
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 339231537506846cb232a2f0cc4a2c662b2d5b07
refs/heads/master: 061cb4a0ec34a6e3069d5a1b3c547e55a71498c5
37 changes: 37 additions & 0 deletions trunk/net/ipv4/netfilter/ip_conntrack_netlink.c
Original file line number Diff line number Diff line change
Expand Up @@ -949,6 +949,31 @@ ctnetlink_change_timeout(struct ip_conntrack *ct, struct nfattr *cda[])
return 0;
}

static inline int
ctnetlink_change_protoinfo(struct ip_conntrack *ct, struct nfattr *cda[])
{
struct nfattr *tb[CTA_PROTOINFO_MAX], *attr = cda[CTA_PROTOINFO-1];
struct ip_conntrack_protocol *proto;
u_int16_t npt = ct->tuplehash[IP_CT_DIR_ORIGINAL].tuple.dst.protonum;
int err = 0;

if (nfattr_parse_nested(tb, CTA_PROTOINFO_MAX, attr) < 0)
goto nfattr_failure;

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

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

return err;

nfattr_failure:
return -ENOMEM;
}

static int
ctnetlink_change_conntrack(struct ip_conntrack *ct, struct nfattr *cda[])
{
Expand All @@ -974,6 +999,12 @@ ctnetlink_change_conntrack(struct ip_conntrack *ct, struct nfattr *cda[])
return err;
}

if (cda[CTA_PROTOINFO-1]) {
err = ctnetlink_change_protoinfo(ct, cda);
if (err < 0)
return err;
}

DEBUGP("all done\n");
return 0;
}
Expand Down Expand Up @@ -1003,6 +1034,12 @@ ctnetlink_create_conntrack(struct nfattr *cda[],
if (err < 0)
goto err;

if (cda[CTA_PROTOINFO-1]) {
err = ctnetlink_change_protoinfo(ct, cda);
if (err < 0)
return err;
}

ct->helper = ip_conntrack_helper_find_get(rtuple);

add_timer(&ct->timeout);
Expand Down

0 comments on commit 82237d0

Please sign in to comment.