netfilter: nf_tables: convert sets to u32 data pointers
authorPatrick McHardy <kaber@trash.net>
Sat, 11 Apr 2015 01:27:35 +0000 (02:27 +0100)
committerPablo Neira Ayuso <pablo@netfilter.org>
Mon, 13 Apr 2015 15:17:27 +0000 (17:17 +0200)
Simple conversion to use u32 pointers to the beginning of the data
area to keep follow up patches smaller.

Signed-off-by: Patrick McHardy <kaber@trash.net>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
include/net/netfilter/nf_tables.h
net/netfilter/nft_hash.c
net/netfilter/nft_rbtree.c

index fca0b5def6297f1048de229c5843ea54df1f7949..efcf46ddd1d5f15aaf578fab70509b454ef97fc7 100644 (file)
@@ -231,10 +231,10 @@ struct nft_expr;
  */
 struct nft_set_ops {
        bool                            (*lookup)(const struct nft_set *set,
-                                                 const struct nft_data *key,
+                                                 const u32 *key,
                                                  const struct nft_set_ext **ext);
        bool                            (*update)(struct nft_set *set,
-                                                 const struct nft_data *key,
+                                                 const u32 *key,
                                                  void *(*new)(struct nft_set *,
                                                               const struct nft_expr *,
                                                               struct nft_regs *),
index 26ba4e192121c69ee255462c21aa02ffa445b29d..767df41d28ea0b3d9d29d9402d8b2740e4973229 100644 (file)
@@ -36,7 +36,7 @@ struct nft_hash_elem {
 
 struct nft_hash_cmp_arg {
        const struct nft_set            *set;
-       const struct nft_data           *key;
+       const u32                       *key;
        u8                              genmask;
 };
 
@@ -71,8 +71,7 @@ static inline int nft_hash_cmp(struct rhashtable_compare_arg *arg,
        return 0;
 }
 
-static bool nft_hash_lookup(const struct nft_set *set,
-                           const struct nft_data *key,
+static bool nft_hash_lookup(const struct nft_set *set, const u32 *key,
                            const struct nft_set_ext **ext)
 {
        struct nft_hash *priv = nft_set_priv(set);
@@ -90,7 +89,7 @@ static bool nft_hash_lookup(const struct nft_set *set,
        return !!he;
 }
 
-static bool nft_hash_update(struct nft_set *set, const struct nft_data *key,
+static bool nft_hash_update(struct nft_set *set, const u32 *key,
                            void *(*new)(struct nft_set *,
                                         const struct nft_expr *,
                                         struct nft_regs *regs),
@@ -134,7 +133,7 @@ static int nft_hash_insert(const struct nft_set *set,
        struct nft_hash_cmp_arg arg = {
                .genmask = nft_genmask_next(read_pnet(&set->pnet)),
                .set     = set,
-               .key     = &elem->key,
+               .key     = elem->key.data,
        };
 
        return rhashtable_lookup_insert_key(&priv->ht, &arg, &he->node,
@@ -158,7 +157,7 @@ static void *nft_hash_deactivate(const struct nft_set *set,
        struct nft_hash_cmp_arg arg = {
                .genmask = nft_genmask_next(read_pnet(&set->pnet)),
                .set     = set,
-               .key     = &elem->key,
+               .key     = elem->key.data,
        };
 
        rcu_read_lock();
index b398f1a856d5eee777e3d9cfae48938a00545342..b888e0cdf1e2650f67e48266a0837b3fb0f845ad 100644 (file)
@@ -30,8 +30,7 @@ struct nft_rbtree_elem {
 };
 
 
-static bool nft_rbtree_lookup(const struct nft_set *set,
-                             const struct nft_data *key,
+static bool nft_rbtree_lookup(const struct nft_set *set, const u32 *key,
                              const struct nft_set_ext **ext)
 {
        const struct nft_rbtree *priv = nft_set_priv(set);