summaryrefslogtreecommitdiffstats
path: root/include/net
diff options
context:
space:
mode:
authorPablo Neira Ayuso <pablo@netfilter.org>2018-01-09 02:38:03 +0100
committerPablo Neira Ayuso <pablo@netfilter.org>2018-01-10 15:32:08 +0100
commit36596dadf54a920d26286cf9f421fb4ef648b51f (patch)
treee9e5cdd54acb21f0ccfa88c851bb7f6418bc4609 /include/net
parent1ea26cca52e46c0f29ee9fdd567312ba93a7d651 (diff)
downloadop-kernel-dev-36596dadf54a920d26286cf9f421fb4ef648b51f.zip
op-kernel-dev-36596dadf54a920d26286cf9f421fb4ef648b51f.tar.gz
netfilter: nf_tables: add single table list for all families
Place all existing user defined tables in struct net *, instead of having one list per family. This saves us from one level of indentation in netlink dump functions. Place pointer to struct nft_af_info in struct nft_table temporarily, as we still need this to put back reference module reference counter on table removal. This patch comes in preparation for the removal of struct nft_af_info. Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Diffstat (limited to 'include/net')
-rw-r--r--include/net/netfilter/nf_tables.h8
-rw-r--r--include/net/netns/nftables.h1
2 files changed, 5 insertions, 4 deletions
diff --git a/include/net/netfilter/nf_tables.h b/include/net/netfilter/nf_tables.h
index 9a85893..c55e836 100644
--- a/include/net/netfilter/nf_tables.h
+++ b/include/net/netfilter/nf_tables.h
@@ -143,22 +143,22 @@ static inline void nft_data_debug(const struct nft_data *data)
* struct nft_ctx - nf_tables rule/set context
*
* @net: net namespace
- * @afi: address family info
* @table: the table the chain is contained in
* @chain: the chain the rule is contained in
* @nla: netlink attributes
* @portid: netlink portID of the original message
* @seq: netlink sequence number
+ * @family: protocol family
* @report: notify via unicast netlink message
*/
struct nft_ctx {
struct net *net;
- struct nft_af_info *afi;
struct nft_table *table;
struct nft_chain *chain;
const struct nlattr * const *nla;
u32 portid;
u32 seq;
+ u8 family;
bool report;
};
@@ -949,6 +949,7 @@ unsigned int nft_do_chain(struct nft_pktinfo *pkt, void *priv);
* @use: number of chain references to this table
* @flags: table flag (see enum nft_table_flags)
* @genmask: generation mask
+ * @afinfo: address family info
* @name: name of the table
*/
struct nft_table {
@@ -961,6 +962,7 @@ struct nft_table {
u32 use;
u16 flags:14,
genmask:2;
+ struct nft_af_info *afi;
char *name;
};
@@ -970,13 +972,11 @@ struct nft_table {
* @list: used internally
* @family: address family
* @owner: module owner
- * @tables: used internally
*/
struct nft_af_info {
struct list_head list;
int family;
struct module *owner;
- struct list_head tables;
};
int nft_register_afinfo(struct net *, struct nft_af_info *);
diff --git a/include/net/netns/nftables.h b/include/net/netns/nftables.h
index 4109b5f..7f86a63 100644
--- a/include/net/netns/nftables.h
+++ b/include/net/netns/nftables.h
@@ -8,6 +8,7 @@ struct nft_af_info;
struct netns_nftables {
struct list_head af_info;
+ struct list_head tables;
struct list_head commit_list;
struct nft_af_info *ipv4;
struct nft_af_info *ipv6;
OpenPOWER on IntegriCloud