From 678ec919ffe3072468cb56de6eabf8cb8f7e9bdb Mon Sep 17 00:00:00 2001 From: Pablo Neira Ayuso Date: Mon, 6 Feb 2012 22:51:32 +0100 Subject: expect: add expectfn support This patch allows you to set expectfn. Signed-off-by: Pablo Neira Ayuso --- src/expect/build.c | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'src/expect/build.c') 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; } -- cgit v1.2.3