summaryrefslogtreecommitdiffstats
path: root/src/expect/build.c
diff options
context:
space:
mode:
authorPablo Neira Ayuso <pablo@netfilter.org>2012-02-06 22:51:32 +0100
committerPablo Neira Ayuso <pablo@netfilter.org>2012-02-06 23:44:06 +0100
commit678ec919ffe3072468cb56de6eabf8cb8f7e9bdb (patch)
tree181dac32a7f2ddb19e47fe848c7247f9a5a9c61c /src/expect/build.c
parentc9983354fa65c835643f85567f57cc8e9992cd29 (diff)
expect: add expectfn support
This patch allows you to set expectfn. Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Diffstat (limited to 'src/expect/build.c')
-rw-r--r--src/expect/build.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/expect/build.c b/src/expect/build.c
index 8cf2edd..a544ded 100644
--- a/src/expect/build.c
+++ b/src/expect/build.c
@@ -42,6 +42,13 @@ static void __build_helper_name(struct nfnlhdr *req, size_t size,
exp->helper_name, strlen(exp->helper_name));
}
+static void __build_expectfn(struct nfnlhdr *req,
+ size_t size, const struct nf_expect *exp)
+{
+ nfnl_addattr_l(&req->nlh, size, CTA_EXPECT_FN,
+ exp->expectfn, strlen(exp->expectfn)+1);
+}
+
int __build_expect(struct nfnl_subsys_handle *ssh,
struct nfnlhdr *req,
size_t size,
@@ -95,6 +102,8 @@ int __build_expect(struct nfnl_subsys_handle *ssh,
__build_class(req, size, exp);
if (test_bit(ATTR_EXP_HELPER_NAME, exp->set))
__build_helper_name(req, size, exp);
+ if (test_bit(ATTR_EXP_FN, exp->set))
+ __build_expectfn(req, size, exp);
return 0;
}