Commit 7286ff7f authored by Pablo Neira Ayuso's avatar Pablo Neira Ayuso

netfilter: nf_tables: honor NFT_SET_OBJECT in set backend selection

Check for NFT_SET_OBJECT feature flag, otherwise we may end up selecting
the wrong set backend.
Signed-off-by: default avatarPablo Neira Ayuso <pablo@netfilter.org>
parent fc52497e
...@@ -2424,7 +2424,8 @@ nft_select_set_ops(const struct nlattr * const nla[], ...@@ -2424,7 +2424,8 @@ nft_select_set_ops(const struct nlattr * const nla[],
features = 0; features = 0;
if (nla[NFTA_SET_FLAGS] != NULL) { if (nla[NFTA_SET_FLAGS] != NULL) {
features = ntohl(nla_get_be32(nla[NFTA_SET_FLAGS])); features = ntohl(nla_get_be32(nla[NFTA_SET_FLAGS]));
features &= NFT_SET_INTERVAL | NFT_SET_MAP | NFT_SET_TIMEOUT; features &= NFT_SET_INTERVAL | NFT_SET_MAP | NFT_SET_TIMEOUT |
NFT_SET_OBJECT;
} }
bops = NULL; bops = NULL;
......
...@@ -404,7 +404,7 @@ static struct nft_set_ops nft_hash_ops __read_mostly = { ...@@ -404,7 +404,7 @@ static struct nft_set_ops nft_hash_ops __read_mostly = {
.lookup = nft_hash_lookup, .lookup = nft_hash_lookup,
.update = nft_hash_update, .update = nft_hash_update,
.walk = nft_hash_walk, .walk = nft_hash_walk,
.features = NFT_SET_MAP | NFT_SET_TIMEOUT, .features = NFT_SET_MAP | NFT_SET_OBJECT | NFT_SET_TIMEOUT,
.owner = THIS_MODULE, .owner = THIS_MODULE,
}; };
......
...@@ -310,7 +310,7 @@ static struct nft_set_ops nft_rbtree_ops __read_mostly = { ...@@ -310,7 +310,7 @@ static struct nft_set_ops nft_rbtree_ops __read_mostly = {
.activate = nft_rbtree_activate, .activate = nft_rbtree_activate,
.lookup = nft_rbtree_lookup, .lookup = nft_rbtree_lookup,
.walk = nft_rbtree_walk, .walk = nft_rbtree_walk,
.features = NFT_SET_INTERVAL | NFT_SET_MAP, .features = NFT_SET_INTERVAL | NFT_SET_MAP | NFT_SET_OBJECT,
.owner = THIS_MODULE, .owner = THIS_MODULE,
}; };
......
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