diff options
author | Florian Westphal <fw@strlen.de> | 2017-02-28 00:59:07 +0100 |
---|---|---|
committer | Pablo Neira Ayuso <pablo@netfilter.org> | 2017-02-28 00:59:42 +0100 |
commit | ed66d9966294a3bab6c8611e369861ba57374743 (patch) | |
tree | aa91c0359789cb81f82a9c06c7be160965ee01be /src/ct.c | |
parent | 2d09a04a12c8564f8044788b2e69da04671230d7 (diff) |
src: support zone set statement with optional direction
nft automatically understands 'ct zone set 1' but when a direction is
specified too we get a parser error since they are currently only
allowed for plain ct expressions.
This permits the existing syntax ('ct original zone') for all tokens with
an optional direction also for set statements.
Signed-off-by: Florian Westphal <fw@strlen.de>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Diffstat (limited to 'src/ct.c')
-rw-r--r-- | src/ct.c | 7 |
1 files changed, 5 insertions, 2 deletions
@@ -404,7 +404,8 @@ void ct_expr_update_type(struct proto_ctx *ctx, struct expr *expr) static void ct_stmt_print(const struct stmt *stmt) { - printf("ct %s set ", ct_templates[stmt->ct.key].token); + ct_print(stmt->ct.key, stmt->ct.direction); + printf(" set "); expr_print(stmt->ct.expr); } @@ -415,7 +416,7 @@ static const struct stmt_ops ct_stmt_ops = { }; struct stmt *ct_stmt_alloc(const struct location *loc, enum nft_ct_keys key, - struct expr *expr) + int8_t direction, struct expr *expr) { struct stmt *stmt; @@ -423,6 +424,8 @@ struct stmt *ct_stmt_alloc(const struct location *loc, enum nft_ct_keys key, stmt->ct.key = key; stmt->ct.tmpl = &ct_templates[key]; stmt->ct.expr = expr; + stmt->ct.direction = direction; + return stmt; } |