summaryrefslogtreecommitdiffstats
path: root/src/expr/ct.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/expr/ct.c')
-rw-r--r--src/expr/ct.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/expr/ct.c b/src/expr/ct.c
index 61a8fef..c6d11c9 100644
--- a/src/expr/ct.c
+++ b/src/expr/ct.c
@@ -27,6 +27,9 @@ struct nft_expr_ct {
uint8_t dir;
};
+#define IP_CT_DIR_ORIGINAL 0
+#define IP_CT_DIR_REPLY 1
+
static int
nft_rule_expr_ct_set(struct nft_rule_expr *e, uint16_t type,
const void *data, size_t data_len)
@@ -202,6 +205,9 @@ static int nft_rule_expr_ct_xml_parse(struct nft_rule_expr *e, char *xml)
if (tmp > UINT8_MAX || tmp < 0 || *endptr)
goto err;
+ if (tmp != IP_CT_DIR_ORIGINAL && tmp != IP_CT_DIR_REPLY)
+ goto err;
+
ct->dir = tmp;
e->flags |= (1 << NFT_EXPR_CT_DIR);