path: root/src/netlink_linearize.c
diff options
authorFlorian Westphal <>2017-02-28 00:59:07 +0100
committerPablo Neira Ayuso <>2017-02-28 00:59:42 +0100
commited66d9966294a3bab6c8611e369861ba57374743 (patch)
treeaa91c0359789cb81f82a9c06c7be160965ee01be /src/netlink_linearize.c
parent2d09a04a12c8564f8044788b2e69da04671230d7 (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 <> Signed-off-by: Pablo Neira Ayuso <>
Diffstat (limited to 'src/netlink_linearize.c')
1 files changed, 4 insertions, 0 deletions
diff --git a/src/netlink_linearize.c b/src/netlink_linearize.c
index 8849b0e4..48f34c25 100644
--- a/src/netlink_linearize.c
+++ b/src/netlink_linearize.c
@@ -1151,6 +1151,10 @@ static void netlink_gen_ct_stmt(struct netlink_linearize_ctx *ctx,
nle = alloc_nft_expr("ct");
netlink_put_register(nle, NFTNL_EXPR_CT_SREG, sreg);
nftnl_expr_set_u32(nle, NFTNL_EXPR_CT_KEY, stmt->ct.key);
+ if (stmt->ct.direction >= 0)
+ nftnl_expr_set_u8(nle, NFTNL_EXPR_CT_DIR,
+ stmt->ct.direction);
nftnl_rule_add_expr(ctx->nlr, nle);