1 From: Pablo Neira Ayuso <pablo@netfilter.org>
2 Date: Tue, 19 Dec 2017 13:40:22 +0100
3 Subject: [PATCH] netfilter: nf_tables: remove struct nft_af_info parameter in
4 nf_tables_chain_type_lookup()
6 Pass family number instead, this comes in preparation for the removal of
9 Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
12 --- a/net/netfilter/nf_tables_api.c
13 +++ b/net/netfilter/nf_tables_api.c
14 @@ -423,7 +423,7 @@ static inline u64 nf_tables_alloc_handle
15 static const struct nf_chain_type *chain_type[NFPROTO_NUMPROTO][NFT_CHAIN_T_MAX];
17 static const struct nf_chain_type *
18 -__nf_tables_chain_type_lookup(int family, const struct nlattr *nla)
19 +__nf_tables_chain_type_lookup(const struct nlattr *nla, u8 family)
23 @@ -436,22 +436,20 @@ __nf_tables_chain_type_lookup(int family
26 static const struct nf_chain_type *
27 -nf_tables_chain_type_lookup(const struct nft_af_info *afi,
28 - const struct nlattr *nla,
30 +nf_tables_chain_type_lookup(const struct nlattr *nla, u8 family, bool autoload)
32 const struct nf_chain_type *type;
34 - type = __nf_tables_chain_type_lookup(afi->family, nla);
35 + type = __nf_tables_chain_type_lookup(nla, family);
40 nfnl_unlock(NFNL_SUBSYS_NFTABLES);
41 - request_module("nft-chain-%u-%.*s", afi->family,
42 + request_module("nft-chain-%u-%.*s", family,
43 nla_len(nla), (const char *)nla_data(nla));
44 nfnl_lock(NFNL_SUBSYS_NFTABLES);
45 - type = __nf_tables_chain_type_lookup(afi->family, nla);
46 + type = __nf_tables_chain_type_lookup(nla, family);
48 return ERR_PTR(-EAGAIN);
50 @@ -1325,8 +1323,8 @@ static int nft_chain_parse_hook(struct n
52 type = chain_type[afi->family][NFT_CHAIN_T_DEFAULT];
53 if (nla[NFTA_CHAIN_TYPE]) {
54 - type = nf_tables_chain_type_lookup(afi, nla[NFTA_CHAIN_TYPE],
56 + type = nf_tables_chain_type_lookup(nla[NFTA_CHAIN_TYPE],
57 + afi->family, create);