diff options
author | Patrick McHardy <kaber@trash.net> | 2015-03-25 14:08:48 +0000 |
---|---|---|
committer | Pablo Neira Ayuso <pablo@netfilter.org> | 2015-03-26 11:09:34 +0100 |
commit | b2832dd6621bf73eb8ad38389a94bd83a5983886 (patch) | |
tree | a60547029ce1982087446a925e811b51e71c1549 /net/netfilter/nft_lookup.c | |
parent | 61edafbb47e9f46fb850035b1f8f062564445704 (diff) | |
download | op-kernel-dev-b2832dd6621bf73eb8ad38389a94bd83a5983886.zip op-kernel-dev-b2832dd6621bf73eb8ad38389a94bd83a5983886.tar.gz |
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_lookup.c')
-rw-r--r-- | net/netfilter/nft_lookup.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/net/netfilter/nft_lookup.c b/net/netfilter/nft_lookup.c index 9615b8b..a5f30b8 100644 --- a/net/netfilter/nft_lookup.c +++ b/net/netfilter/nft_lookup.c @@ -31,9 +31,13 @@ static void nft_lookup_eval(const struct nft_expr *expr, { const struct nft_lookup *priv = nft_expr_priv(expr); const struct nft_set *set = priv->set; + const struct nft_set_ext *ext; - if (set->ops->lookup(set, &data[priv->sreg], &data[priv->dreg])) + if (set->ops->lookup(set, &data[priv->sreg], &ext)) { + if (set->flags & NFT_SET_MAP) + nft_data_copy(&data[priv->dreg], nft_set_ext_data(ext)); return; + } data[NFT_REG_VERDICT].verdict = NFT_BREAK; } |