Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 290804
b: refs/heads/master
c: 660fdb2
h: refs/heads/master
v: v3
  • Loading branch information
Pablo Neira Ayuso committed Mar 7, 2012
1 parent 4fa159a commit 02ee386
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 2 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: 7f81c951d961bef0bf9aa55449654302b9da8185
refs/heads/master: 660fdb2a0f5f670da4728d7028d3227296e0226c
30 changes: 29 additions & 1 deletion trunk/net/netfilter/nf_conntrack_netlink.c
Original file line number Diff line number Diff line change
Expand Up @@ -2042,6 +2042,7 @@ ctnetlink_create_expect(struct net *net, u16 zone,
struct nf_conntrack_expect *exp;
struct nf_conn *ct;
struct nf_conn_help *help;
struct nf_conntrack_helper *helper = NULL;
int err = 0;

/* caller guarantees that those three CTA_EXPECT_* exist */
Expand All @@ -2060,6 +2061,33 @@ ctnetlink_create_expect(struct net *net, u16 zone,
if (!h)
return -ENOENT;
ct = nf_ct_tuplehash_to_ctrack(h);

/* Look for helper of this expectation */
if (cda[CTA_EXPECT_HELP_NAME]) {
const char *helpname = nla_data(cda[CTA_EXPECT_HELP_NAME]);

helper = __nf_conntrack_helper_find(helpname, nf_ct_l3num(ct),
nf_ct_protonum(ct));
if (helper == NULL) {
#ifdef CONFIG_MODULES
if (request_module("nfct-helper-%s", helpname) < 0) {
err = -EOPNOTSUPP;
goto out;
}

helper = __nf_conntrack_helper_find(helpname,
nf_ct_l3num(ct),
nf_ct_protonum(ct));
if (helper) {
err = -EAGAIN;
goto out;
}
#endif
err = -EOPNOTSUPP;
goto out;
}
}

exp = nf_ct_expect_alloc(ct);
if (!exp) {
err = -ENOMEM;
Expand Down Expand Up @@ -2090,7 +2118,7 @@ ctnetlink_create_expect(struct net *net, u16 zone,
exp->class = 0;
exp->expectfn = NULL;
exp->master = ct;
exp->helper = NULL;
exp->helper = helper;
memcpy(&exp->tuple, &tuple, sizeof(struct nf_conntrack_tuple));
memcpy(&exp->mask.src.u3, &mask.src.u3, sizeof(exp->mask.src.u3));
exp->mask.src.u.all = mask.src.u.all;
Expand Down

0 comments on commit 02ee386

Please sign in to comment.