Commit cac20fcd authored by Pablo Neira Ayuso's avatar Pablo Neira Ayuso

netfilter: nf_tables: simplify lookup functions

Replace the nf_tables_ prefix by nft_ and merge code into single lookup
function whenever possible. In many cases we go over the 80-chars
boundary function names, this save us ~50 LoC.
Signed-off-by: default avatarPablo Neira Ayuso <pablo@netfilter.org>
parent df1e2025
...@@ -1015,7 +1015,7 @@ static inline void *nft_obj_data(const struct nft_object *obj) ...@@ -1015,7 +1015,7 @@ static inline void *nft_obj_data(const struct nft_object *obj)
#define nft_expr_obj(expr) *((struct nft_object **)nft_expr_priv(expr)) #define nft_expr_obj(expr) *((struct nft_object **)nft_expr_priv(expr))
struct nft_object *nf_tables_obj_lookup(const struct nft_table *table, struct nft_object *nft_obj_lookup(const struct nft_table *table,
const struct nlattr *nla, u32 objtype, const struct nlattr *nla, u32 objtype,
u8 genmask); u8 genmask);
...@@ -1106,7 +1106,7 @@ struct nft_flowtable { ...@@ -1106,7 +1106,7 @@ struct nft_flowtable {
struct nf_flowtable data; struct nf_flowtable data;
}; };
struct nft_flowtable *nf_tables_flowtable_lookup(const struct nft_table *table, struct nft_flowtable *nft_flowtable_lookup(const struct nft_table *table,
const struct nlattr *nla, const struct nlattr *nla,
u8 genmask); u8 genmask);
......
This diff is collapsed.
...@@ -142,8 +142,7 @@ static int nft_flow_offload_init(const struct nft_ctx *ctx, ...@@ -142,8 +142,7 @@ static int nft_flow_offload_init(const struct nft_ctx *ctx,
if (!tb[NFTA_FLOW_TABLE_NAME]) if (!tb[NFTA_FLOW_TABLE_NAME])
return -EINVAL; return -EINVAL;
flowtable = nf_tables_flowtable_lookup(ctx->table, flowtable = nft_flowtable_lookup(ctx->table, tb[NFTA_FLOW_TABLE_NAME],
tb[NFTA_FLOW_TABLE_NAME],
genmask); genmask);
if (IS_ERR(flowtable)) if (IS_ERR(flowtable))
return PTR_ERR(flowtable); return PTR_ERR(flowtable);
......
...@@ -38,7 +38,7 @@ static int nft_objref_init(const struct nft_ctx *ctx, ...@@ -38,7 +38,7 @@ static int nft_objref_init(const struct nft_ctx *ctx,
return -EINVAL; return -EINVAL;
objtype = ntohl(nla_get_be32(tb[NFTA_OBJREF_IMM_TYPE])); objtype = ntohl(nla_get_be32(tb[NFTA_OBJREF_IMM_TYPE]));
obj = nf_tables_obj_lookup(ctx->table, tb[NFTA_OBJREF_IMM_NAME], objtype, obj = nft_obj_lookup(ctx->table, tb[NFTA_OBJREF_IMM_NAME], objtype,
genmask); genmask);
if (IS_ERR(obj)) if (IS_ERR(obj))
return -ENOENT; return -ENOENT;
......
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