Skip to content

Commit d59d2f8

Browse files
committed
netfilter: nftables: add nft_pernet() helper function
Consolidate call to net_generic(net, nf_tables_net_id) in this wrapper function. Signed-off-by: Pablo Neira Ayuso <[email protected]>
1 parent 593268d commit d59d2f8

File tree

5 files changed

+69
-71
lines changed

5 files changed

+69
-71
lines changed

include/net/netfilter/nf_tables.h

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
#include <net/netfilter/nf_flow_table.h>
1414
#include <net/netlink.h>
1515
#include <net/flow_offload.h>
16+
#include <net/netns/generic.h>
1617

1718
#define NFT_MAX_HOOKS (NF_INET_INGRESS + 1)
1819

@@ -1580,4 +1581,11 @@ struct nftables_pernet {
15801581
u8 validate_state;
15811582
};
15821583

1584+
extern unsigned int nf_tables_net_id;
1585+
1586+
static inline struct nftables_pernet *nft_pernet(const struct net *net)
1587+
{
1588+
return net_generic(net, nf_tables_net_id);
1589+
}
1590+
15831591
#endif /* _NET_NF_TABLES_H */

0 commit comments

Comments
 (0)