Loading include/net/netfilter/nf_tables.h +3 −1 Original line number Diff line number Diff line Loading @@ -200,6 +200,8 @@ struct nft_set_estimate { enum nft_set_class class; }; struct nft_set_ext; /** * struct nft_set_ops - nf_tables set operations * Loading @@ -218,7 +220,7 @@ struct nft_set_estimate { struct nft_set_ops { bool (*lookup)(const struct nft_set *set, const struct nft_data *key, struct nft_data *data); const struct nft_set_ext **ext); int (*get)(const struct nft_set *set, struct nft_set_elem *elem); int (*insert)(const struct nft_set *set, Loading net/netfilter/nft_hash.c +3 −3 Original line number Diff line number Diff line Loading @@ -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; Loading @@ -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; } Loading net/netfilter/nft_lookup.c +5 −1 Original line number Diff line number Diff line Loading @@ -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; } Loading net/netfilter/nft_rbtree.c +3 −4 Original line number Diff line number Diff line Loading @@ -31,7 +31,7 @@ struct nft_rbtree_elem { static bool nft_rbtree_lookup(const struct nft_set *set, const struct nft_data *key, struct nft_data *data) const struct nft_set_ext **ext) { const struct nft_rbtree *priv = nft_set_priv(set); const struct nft_rbtree_elem *rbe, *interval = NULL; Loading @@ -55,10 +55,9 @@ static bool nft_rbtree_lookup(const struct nft_set *set, *nft_set_ext_flags(&rbe->ext) & NFT_SET_ELEM_INTERVAL_END) goto out; if (set->flags & NFT_SET_MAP) nft_data_copy(data, nft_set_ext_data(&rbe->ext)); spin_unlock_bh(&nft_rbtree_lock); *ext = &rbe->ext; return true; } } Loading Loading
include/net/netfilter/nf_tables.h +3 −1 Original line number Diff line number Diff line Loading @@ -200,6 +200,8 @@ struct nft_set_estimate { enum nft_set_class class; }; struct nft_set_ext; /** * struct nft_set_ops - nf_tables set operations * Loading @@ -218,7 +220,7 @@ struct nft_set_estimate { struct nft_set_ops { bool (*lookup)(const struct nft_set *set, const struct nft_data *key, struct nft_data *data); const struct nft_set_ext **ext); int (*get)(const struct nft_set *set, struct nft_set_elem *elem); int (*insert)(const struct nft_set *set, Loading
net/netfilter/nft_hash.c +3 −3 Original line number Diff line number Diff line Loading @@ -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; Loading @@ -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; } Loading
net/netfilter/nft_lookup.c +5 −1 Original line number Diff line number Diff line Loading @@ -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; } Loading
net/netfilter/nft_rbtree.c +3 −4 Original line number Diff line number Diff line Loading @@ -31,7 +31,7 @@ struct nft_rbtree_elem { static bool nft_rbtree_lookup(const struct nft_set *set, const struct nft_data *key, struct nft_data *data) const struct nft_set_ext **ext) { const struct nft_rbtree *priv = nft_set_priv(set); const struct nft_rbtree_elem *rbe, *interval = NULL; Loading @@ -55,10 +55,9 @@ static bool nft_rbtree_lookup(const struct nft_set *set, *nft_set_ext_flags(&rbe->ext) & NFT_SET_ELEM_INTERVAL_END) goto out; if (set->flags & NFT_SET_MAP) nft_data_copy(data, nft_set_ext_data(&rbe->ext)); spin_unlock_bh(&nft_rbtree_lock); *ext = &rbe->ext; return true; } } Loading