1 From: Pablo Neira Ayuso <pablo@netfilter.org>
2 Date: Tue, 19 Dec 2017 14:07:52 +0100
3 Subject: [PATCH] netfilter: nf_tables: remove flag field from struct
6 Replace it by a direct check for the netdev protocol family.
8 Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
11 --- a/include/net/netfilter/nf_tables.h
12 +++ b/include/net/netfilter/nf_tables.h
13 @@ -959,10 +959,6 @@ struct nft_table {
18 - NFT_AF_NEEDS_DEV = (1 << 0),
22 * struct nft_af_info - nf_tables address family info
24 @@ -970,14 +966,12 @@ enum nft_af_flags {
25 * @family: address family
26 * @owner: module owner
27 * @tables: used internally
28 - * @flags: family flags
31 struct list_head list;
34 struct list_head tables;
38 int nft_register_afinfo(struct net *, struct nft_af_info *);
39 --- a/net/netfilter/nf_tables_api.c
40 +++ b/net/netfilter/nf_tables_api.c
41 @@ -1379,7 +1379,7 @@ static int nft_chain_parse_hook(struct n
45 - if (afi->flags & NFT_AF_NEEDS_DEV) {
46 + if (afi->family == NFPROTO_NETDEV) {
47 char ifname[IFNAMSIZ];
49 if (!ha[NFTA_HOOK_DEV]) {
50 --- a/net/netfilter/nf_tables_netdev.c
51 +++ b/net/netfilter/nf_tables_netdev.c
52 @@ -41,7 +41,6 @@ nft_do_chain_netdev(void *priv, struct s
53 static struct nft_af_info nft_af_netdev __read_mostly = {
54 .family = NFPROTO_NETDEV,
56 - .flags = NFT_AF_NEEDS_DEV,
59 static int nf_tables_netdev_init_net(struct net *net)