summaryrefslogtreecommitdiffstats
path: root/net/netfilter/nft_hash.c
diff options
context:
space:
mode:
authorPatrick McHardy2015-03-25 15:08:48 +0100
committerPablo Neira Ayuso2015-03-26 11:09:34 +0100
commitb2832dd6621bf73eb8ad38389a94bd83a5983886 (patch)
treea60547029ce1982087446a925e811b51e71c1549 /net/netfilter/nft_hash.c
parentnetfilter: nf_tables: consolide set element destruction (diff)
downloadkernel-qcow2-linux-b2832dd6621bf73eb8ad38389a94bd83a5983886.tar.gz
kernel-qcow2-linux-b2832dd6621bf73eb8ad38389a94bd83a5983886.tar.xz
kernel-qcow2-linux-b2832dd6621bf73eb8ad38389a94bd83a5983886.zip
netfilter: nf_tables: return set extensions from ->lookup()
Return the extension area from the ->lookup() function to allow to consolidate common actions. Signed-off-by: Patrick McHardy <kaber@trash.net> Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Diffstat (limited to 'net/netfilter/nft_hash.c')
-rw-r--r--net/netfilter/nft_hash.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/net/netfilter/nft_hash.c b/net/netfilter/nft_hash.c
index 94bf25def37f..5bee82195ef5 100644
--- a/net/netfilter/nft_hash.c
+++ b/net/netfilter/nft_hash.c
@@ -66,7 +66,7 @@ static inline int nft_hash_cmp(struct rhashtable_compare_arg *arg,
static bool nft_hash_lookup(const struct nft_set *set,
const struct nft_data *key,
- struct nft_data *data)
+ const struct nft_set_ext **ext)
{
struct nft_hash *priv = nft_set_priv(set);
const struct nft_hash_elem *he;
@@ -76,8 +76,8 @@ static bool nft_hash_lookup(const struct nft_set *set,
};
he = rhashtable_lookup_fast(&priv->ht, &arg, nft_hash_params);
- if (he && set->flags & NFT_SET_MAP)
- nft_data_copy(data, nft_set_ext_data(&he->ext));
+ if (he != NULL)
+ *ext = &he->ext;
return !!he;
}