diff options
author | Patrick McHardy <kaber@trash.net> | 2014-02-18 18:06:50 +0000 |
---|---|---|
committer | Pablo Neira Ayuso <pablo@netfilter.org> | 2014-02-25 11:29:26 +0100 |
commit | e0abdadcc6e113ed2e22c85b350074487095875b (patch) | |
tree | 5b2a923050473e8424c8696d90005706d1c7835f /net/netfilter | |
parent | 67a8fc27cca06e185c1ab39baaccd2103f6f9f51 (diff) | |
download | linux-e0abdadcc6e113ed2e22c85b350074487095875b.tar.gz linux-e0abdadcc6e113ed2e22c85b350074487095875b.tar.bz2 linux-e0abdadcc6e113ed2e22c85b350074487095875b.zip |
netfilter: nf_tables: accept QUEUE/DROP verdict parameters
Allow userspace to specify the queue number or the errno code for QUEUE
and DROP verdicts.
Signed-off-by: Patrick McHardy <kaber@trash.net>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Diffstat (limited to 'net/netfilter')
-rw-r--r-- | net/netfilter/nf_tables_api.c | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/net/netfilter/nf_tables_api.c b/net/netfilter/nf_tables_api.c index 4b7e14ddd2b2..0b5634094cb0 100644 --- a/net/netfilter/nf_tables_api.c +++ b/net/netfilter/nf_tables_api.c @@ -3174,9 +3174,16 @@ static int nft_verdict_init(const struct nft_ctx *ctx, struct nft_data *data, data->verdict = ntohl(nla_get_be32(tb[NFTA_VERDICT_CODE])); switch (data->verdict) { - case NF_ACCEPT: - case NF_DROP: - case NF_QUEUE: + default: + switch (data->verdict & NF_VERDICT_MASK) { + case NF_ACCEPT: + case NF_DROP: + case NF_QUEUE: + break; + default: + return -EINVAL; + } + /* fall through */ case NFT_CONTINUE: case NFT_BREAK: case NFT_RETURN: @@ -3197,8 +3204,6 @@ static int nft_verdict_init(const struct nft_ctx *ctx, struct nft_data *data, data->chain = chain; desc->len = sizeof(data); break; - default: - return -EINVAL; } desc->type = NFT_DATA_VERDICT; |