diff options
author | Pablo Neira Ayuso <pablo@netfilter.org> | 2021-01-15 18:40:11 +0100 |
---|---|---|
committer | Pablo Neira Ayuso <pablo@netfilter.org> | 2021-01-15 18:44:24 +0100 |
commit | 8b043938e77b1f421beccff595117d6e4ff8eecc (patch) | |
tree | 39f0caa782cea92ebb3377abeda93a4baf86479f /src | |
parent | 5946b3930b4e568b61065ac4e3cda6f9006e3833 (diff) |
evaluate: disallow ct original {s,d}ddr from maps
test.nft:6:55-71: Error: specify either ip or ip6 for address matching
add rule ip mangle manout ct direction reply mark set ct original daddr map { $ext1_ip : 0x11, $ext2_ip : 0x12 }
^^^^^^^^^^^^^^^^^
Closes: https://bugzilla.netfilter.org/show_bug.cgi?id=1489
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Diffstat (limited to 'src')
-rw-r--r-- | src/evaluate.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/evaluate.c b/src/evaluate.c index 38dbc33d..c830dcdb 100644 --- a/src/evaluate.c +++ b/src/evaluate.c @@ -1472,6 +1472,12 @@ static int expr_evaluate_map(struct eval_ctx *ctx, struct expr **expr) const struct datatype *dtype; struct expr *key, *data; + if (map->map->etype == EXPR_CT && + (map->map->ct.key == NFT_CT_SRC || + map->map->ct.key == NFT_CT_DST)) + return expr_error(ctx->msgs, map->map, + "specify either ip or ip6 for address matching"); + expr_set_context(&ctx->ectx, NULL, 0); if (expr_evaluate(ctx, &map->map) < 0) return -1; |