diff options
author | Pablo Neira Ayuso <pablo@netfilter.org> | 2013-12-27 18:59:38 -0500 |
---|---|---|
committer | Pablo Neira Ayuso <pablo@netfilter.org> | 2013-12-28 16:32:28 -0500 |
commit | 2ee0d3c80fdb7974cfa1c7e25b5048e9fcaf69b6 (patch) | |
tree | 2531aa5fe8377d3374cc138963e2d52ff6bf12ab /net/netfilter | |
parent | d2012975619251bdfeb7a5159faa7727ea9cddd3 (diff) |
netfilter: nf_tables: fix wrong datatype in nft_validate_data_load()
This patch fixes dictionary mappings, eg.
add rule ip filter input meta dnat set tcp dport map { 22 => 1.1.1.1, 23 => 2.2.2.2 }
The kernel was returning -EINVAL in nft_validate_data_load() since
the type of the set element data that is passed was the real userspace
datatype instead of NFT_DATA_VALUE.
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Diffstat (limited to 'net/netfilter')
-rw-r--r-- | net/netfilter/nf_tables_api.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/net/netfilter/nf_tables_api.c b/net/netfilter/nf_tables_api.c index d65c80b0e84d..71a9f49a768b 100644 --- a/net/netfilter/nf_tables_api.c +++ b/net/netfilter/nf_tables_api.c | |||
@@ -2382,7 +2382,9 @@ static int nf_tables_bind_check_setelem(const struct nft_ctx *ctx, | |||
2382 | enum nft_registers dreg; | 2382 | enum nft_registers dreg; |
2383 | 2383 | ||
2384 | dreg = nft_type_to_reg(set->dtype); | 2384 | dreg = nft_type_to_reg(set->dtype); |
2385 | return nft_validate_data_load(ctx, dreg, &elem->data, set->dtype); | 2385 | return nft_validate_data_load(ctx, dreg, &elem->data, |
2386 | set->dtype == NFT_DATA_VERDICT ? | ||
2387 | NFT_DATA_VERDICT : NFT_DATA_VALUE); | ||
2386 | } | 2388 | } |
2387 | 2389 | ||
2388 | int nf_tables_bind_set(const struct nft_ctx *ctx, struct nft_set *set, | 2390 | int nf_tables_bind_set(const struct nft_ctx *ctx, struct nft_set *set, |