Commit 960bd2c2 authored by Mirek Kratochvil's avatar Mirek Kratochvil Committed by Pablo Neira Ayuso

netfilter: nf_tables: fix bogus warning in nft_data_uninit()

The values 0x00000000-0xfffffeff are reserved for userspace datatype. When,
deleting set elements with maps, a bogus warning is triggered.

WARNING: CPU: 0 PID: 11133 at net/netfilter/nf_tables_api.c:4481 nft_data_uninit+0x35/0x40 [nf_tables]()

This fixes the check accordingly to enum definition in
include/linux/netfilter/nf_tables.h

Fixes: https://bugzilla.netfilter.org/show_bug.cgi?id=1013Signed-off-by: default avatarMirek Kratochvil <exa.exa@gmail.com>
Signed-off-by: default avatarPablo Neira Ayuso <pablo@netfilter.org>
parent b3cad287
...@@ -4472,9 +4472,9 @@ EXPORT_SYMBOL_GPL(nft_data_init); ...@@ -4472,9 +4472,9 @@ EXPORT_SYMBOL_GPL(nft_data_init);
*/ */
void nft_data_uninit(const struct nft_data *data, enum nft_data_types type) void nft_data_uninit(const struct nft_data *data, enum nft_data_types type)
{ {
switch (type) { if (type < NFT_DATA_VERDICT)
case NFT_DATA_VALUE:
return; return;
switch (type) {
case NFT_DATA_VERDICT: case NFT_DATA_VERDICT:
return nft_verdict_uninit(data); return nft_verdict_uninit(data);
default: default:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment