diff options
author | Pablo Neira Ayuso <pablo@netfilter.org> | 2010-10-07 17:43:50 +0200 |
---|---|---|
committer | Pablo Neira Ayuso <pablo@netfilter.org> | 2010-10-07 17:43:50 +0200 |
commit | 92e66d4e07d20e73606e2110144199b81663dc35 (patch) | |
tree | 7e0ef1425480c079e9de53745830bd9d2cdf62e3 /src/expect/build.c | |
parent | b24f4ac006dcc3f2c6a904af2f3eb02bd4d16ea2 (diff) |
expect: add support for CTA_EXPECT_FLAGS
This patch allows to set the expectation flags from user-space.
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Diffstat (limited to 'src/expect/build.c')
-rw-r--r-- | src/expect/build.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/expect/build.c b/src/expect/build.c index e7f547f..c1a5a1d 100644 --- a/src/expect/build.c +++ b/src/expect/build.c @@ -20,6 +20,12 @@ static void __build_zone(struct nfnlhdr *req, size_t size, nfnl_addattr16(&req->nlh, size, CTA_EXPECT_ZONE, htons(exp->zone)); } +static void __build_flags(struct nfnlhdr *req, + size_t size, const struct nf_expect *exp) +{ + nfnl_addattr32(&req->nlh, size, CTA_EXPECT_FLAGS,htonl(exp->flags)); +} + int __build_expect(struct nfnl_subsys_handle *ssh, struct nfnlhdr *req, size_t size, @@ -63,7 +69,8 @@ int __build_expect(struct nfnl_subsys_handle *ssh, if (test_bit(ATTR_EXP_TIMEOUT, exp->set)) __build_timeout(req, size, exp); - + if (test_bit(ATTR_EXP_FLAGS, exp->set)) + __build_flags(req, size, exp); if (test_bit(ATTR_EXP_ZONE, exp->set)) __build_zone(req, size, exp); |