Skip to content

Commit

Permalink
netfilter: nf_tables: accept QUEUE/DROP verdict parameters
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Patrick McHardy authored and Pablo Neira Ayuso committed Feb 25, 2014
1 parent 67a8fc2 commit e0abdad
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions net/netfilter/nf_tables_api.c
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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;
Expand Down

0 comments on commit e0abdad

Please sign in to comment.