netfilter: nf_tables: reject NFT_SET_ELEM_INTERVAL_END flag for non-interval sets

Signed-off-by: Patrick McHardy <kaber@trash.net>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
This commit is contained in:
Patrick McHardy 2015-03-21 15:19:16 +00:00 committed by Pablo Neira Ayuso
parent 16c45eda96
commit 55df35d22f

View File

@ -3138,6 +3138,9 @@ static int nft_add_set_elem(struct nft_ctx *ctx, struct nft_set *set,
elem.flags = ntohl(nla_get_be32(nla[NFTA_SET_ELEM_FLAGS]));
if (elem.flags & ~NFT_SET_ELEM_INTERVAL_END)
return -EINVAL;
if (!(set->flags & NFT_SET_INTERVAL) &&
elem.flags & NFT_SET_ELEM_INTERVAL_END)
return -EINVAL;
}
if (set->flags & NFT_SET_MAP) {