aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPablo Neira Ayuso <pablo@netfilter.org>2018-03-27 05:53:05 -0400
committerPablo Neira Ayuso <pablo@netfilter.org>2018-03-30 05:29:17 -0400
commit32537e91847a5686d57d3811c075a46b2d9b6434 (patch)
tree95f211d0ba7d991aa756c93d82654be60aea279d
parent9124a20d8794663a396b5d6f91f66903848a042b (diff)
netfilter: nf_tables: rename struct nf_chain_type
Use nft_ prefix. By when I added chain types, I forgot to use the nftables prefix. Rename enum nft_chain_type to enum nft_chain_types too, otherwise there is an overlap. Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
-rw-r--r--include/net/netfilter/nf_tables.h16
-rw-r--r--net/bridge/netfilter/nf_tables_bridge.c2
-rw-r--r--net/ipv4/netfilter/nf_tables_arp.c2
-rw-r--r--net/ipv4/netfilter/nf_tables_ipv4.c2
-rw-r--r--net/ipv4/netfilter/nft_chain_nat_ipv4.c2
-rw-r--r--net/ipv4/netfilter/nft_chain_route_ipv4.c2
-rw-r--r--net/ipv6/netfilter/nf_tables_ipv6.c2
-rw-r--r--net/ipv6/netfilter/nft_chain_nat_ipv6.c2
-rw-r--r--net/ipv6/netfilter/nft_chain_route_ipv6.c2
-rw-r--r--net/netfilter/nf_tables_api.c18
-rw-r--r--net/netfilter/nf_tables_inet.c2
-rw-r--r--net/netfilter/nf_tables_netdev.c2
12 files changed, 27 insertions, 27 deletions
diff --git a/include/net/netfilter/nf_tables.h b/include/net/netfilter/nf_tables.h
index 663b015dace5..4a304997c304 100644
--- a/include/net/netfilter/nf_tables.h
+++ b/include/net/netfilter/nf_tables.h
@@ -868,7 +868,7 @@ struct nft_chain {
868 char *name; 868 char *name;
869}; 869};
870 870
871enum nft_chain_type { 871enum nft_chain_types {
872 NFT_CHAIN_T_DEFAULT = 0, 872 NFT_CHAIN_T_DEFAULT = 0,
873 NFT_CHAIN_T_ROUTE, 873 NFT_CHAIN_T_ROUTE,
874 NFT_CHAIN_T_NAT, 874 NFT_CHAIN_T_NAT,
@@ -876,7 +876,7 @@ enum nft_chain_type {
876}; 876};
877 877
878/** 878/**
879 * struct nf_chain_type - nf_tables chain type info 879 * struct nft_chain_type - nf_tables chain type info
880 * 880 *
881 * @name: name of the type 881 * @name: name of the type
882 * @type: numeric identifier 882 * @type: numeric identifier
@@ -885,9 +885,9 @@ enum nft_chain_type {
885 * @hook_mask: mask of valid hooks 885 * @hook_mask: mask of valid hooks
886 * @hooks: array of hook functions 886 * @hooks: array of hook functions
887 */ 887 */
888struct nf_chain_type { 888struct nft_chain_type {
889 const char *name; 889 const char *name;
890 enum nft_chain_type type; 890 enum nft_chain_types type;
891 int family; 891 int family;
892 struct module *owner; 892 struct module *owner;
893 unsigned int hook_mask; 893 unsigned int hook_mask;
@@ -895,7 +895,7 @@ struct nf_chain_type {
895}; 895};
896 896
897int nft_chain_validate_dependency(const struct nft_chain *chain, 897int nft_chain_validate_dependency(const struct nft_chain *chain,
898 enum nft_chain_type type); 898 enum nft_chain_types type);
899int nft_chain_validate_hooks(const struct nft_chain *chain, 899int nft_chain_validate_hooks(const struct nft_chain *chain,
900 unsigned int hook_flags); 900 unsigned int hook_flags);
901 901
@@ -917,7 +917,7 @@ struct nft_stats {
917 */ 917 */
918struct nft_base_chain { 918struct nft_base_chain {
919 struct nf_hook_ops ops; 919 struct nf_hook_ops ops;
920 const struct nf_chain_type *type; 920 const struct nft_chain_type *type;
921 u8 policy; 921 u8 policy;
922 u8 flags; 922 u8 flags;
923 struct nft_stats __percpu *stats; 923 struct nft_stats __percpu *stats;
@@ -970,8 +970,8 @@ struct nft_table {
970 char *name; 970 char *name;
971}; 971};
972 972
973int nft_register_chain_type(const struct nf_chain_type *); 973int nft_register_chain_type(const struct nft_chain_type *);
974void nft_unregister_chain_type(const struct nf_chain_type *); 974void nft_unregister_chain_type(const struct nft_chain_type *);
975 975
976int nft_register_expr(struct nft_expr_type *); 976int nft_register_expr(struct nft_expr_type *);
977void nft_unregister_expr(struct nft_expr_type *); 977void nft_unregister_expr(struct nft_expr_type *);
diff --git a/net/bridge/netfilter/nf_tables_bridge.c b/net/bridge/netfilter/nf_tables_bridge.c
index 5160cf614176..73a1ec556a0a 100644
--- a/net/bridge/netfilter/nf_tables_bridge.c
+++ b/net/bridge/netfilter/nf_tables_bridge.c
@@ -42,7 +42,7 @@ nft_do_chain_bridge(void *priv,
42 return nft_do_chain(&pkt, priv); 42 return nft_do_chain(&pkt, priv);
43} 43}
44 44
45static const struct nf_chain_type filter_bridge = { 45static const struct nft_chain_type filter_bridge = {
46 .name = "filter", 46 .name = "filter",
47 .type = NFT_CHAIN_T_DEFAULT, 47 .type = NFT_CHAIN_T_DEFAULT,
48 .family = NFPROTO_BRIDGE, 48 .family = NFPROTO_BRIDGE,
diff --git a/net/ipv4/netfilter/nf_tables_arp.c b/net/ipv4/netfilter/nf_tables_arp.c
index 036c074736b0..5b0be2a10b69 100644
--- a/net/ipv4/netfilter/nf_tables_arp.c
+++ b/net/ipv4/netfilter/nf_tables_arp.c
@@ -27,7 +27,7 @@ nft_do_chain_arp(void *priv,
27 return nft_do_chain(&pkt, priv); 27 return nft_do_chain(&pkt, priv);
28} 28}
29 29
30static const struct nf_chain_type filter_arp = { 30static const struct nft_chain_type filter_arp = {
31 .name = "filter", 31 .name = "filter",
32 .type = NFT_CHAIN_T_DEFAULT, 32 .type = NFT_CHAIN_T_DEFAULT,
33 .family = NFPROTO_ARP, 33 .family = NFPROTO_ARP,
diff --git a/net/ipv4/netfilter/nf_tables_ipv4.c b/net/ipv4/netfilter/nf_tables_ipv4.c
index 96f955496d5f..13bae5cfa257 100644
--- a/net/ipv4/netfilter/nf_tables_ipv4.c
+++ b/net/ipv4/netfilter/nf_tables_ipv4.c
@@ -30,7 +30,7 @@ static unsigned int nft_do_chain_ipv4(void *priv,
30 return nft_do_chain(&pkt, priv); 30 return nft_do_chain(&pkt, priv);
31} 31}
32 32
33static const struct nf_chain_type filter_ipv4 = { 33static const struct nft_chain_type filter_ipv4 = {
34 .name = "filter", 34 .name = "filter",
35 .type = NFT_CHAIN_T_DEFAULT, 35 .type = NFT_CHAIN_T_DEFAULT,
36 .family = NFPROTO_IPV4, 36 .family = NFPROTO_IPV4,
diff --git a/net/ipv4/netfilter/nft_chain_nat_ipv4.c b/net/ipv4/netfilter/nft_chain_nat_ipv4.c
index f2a490981594..167f377eb1cb 100644
--- a/net/ipv4/netfilter/nft_chain_nat_ipv4.c
+++ b/net/ipv4/netfilter/nft_chain_nat_ipv4.c
@@ -67,7 +67,7 @@ static unsigned int nft_nat_ipv4_local_fn(void *priv,
67 return nf_nat_ipv4_local_fn(priv, skb, state, nft_nat_do_chain); 67 return nf_nat_ipv4_local_fn(priv, skb, state, nft_nat_do_chain);
68} 68}
69 69
70static const struct nf_chain_type nft_chain_nat_ipv4 = { 70static const struct nft_chain_type nft_chain_nat_ipv4 = {
71 .name = "nat", 71 .name = "nat",
72 .type = NFT_CHAIN_T_NAT, 72 .type = NFT_CHAIN_T_NAT,
73 .family = NFPROTO_IPV4, 73 .family = NFPROTO_IPV4,
diff --git a/net/ipv4/netfilter/nft_chain_route_ipv4.c b/net/ipv4/netfilter/nft_chain_route_ipv4.c
index d965c225b9f6..48cf1f892314 100644
--- a/net/ipv4/netfilter/nft_chain_route_ipv4.c
+++ b/net/ipv4/netfilter/nft_chain_route_ipv4.c
@@ -58,7 +58,7 @@ static unsigned int nf_route_table_hook(void *priv,
58 return ret; 58 return ret;
59} 59}
60 60
61static const struct nf_chain_type nft_chain_route_ipv4 = { 61static const struct nft_chain_type nft_chain_route_ipv4 = {
62 .name = "route", 62 .name = "route",
63 .type = NFT_CHAIN_T_ROUTE, 63 .type = NFT_CHAIN_T_ROUTE,
64 .family = NFPROTO_IPV4, 64 .family = NFPROTO_IPV4,
diff --git a/net/ipv6/netfilter/nf_tables_ipv6.c b/net/ipv6/netfilter/nf_tables_ipv6.c
index 17e03589331c..d99f9ac6f1b6 100644
--- a/net/ipv6/netfilter/nf_tables_ipv6.c
+++ b/net/ipv6/netfilter/nf_tables_ipv6.c
@@ -28,7 +28,7 @@ static unsigned int nft_do_chain_ipv6(void *priv,
28 return nft_do_chain(&pkt, priv); 28 return nft_do_chain(&pkt, priv);
29} 29}
30 30
31static const struct nf_chain_type filter_ipv6 = { 31static const struct nft_chain_type filter_ipv6 = {
32 .name = "filter", 32 .name = "filter",
33 .type = NFT_CHAIN_T_DEFAULT, 33 .type = NFT_CHAIN_T_DEFAULT,
34 .family = NFPROTO_IPV6, 34 .family = NFPROTO_IPV6,
diff --git a/net/ipv6/netfilter/nft_chain_nat_ipv6.c b/net/ipv6/netfilter/nft_chain_nat_ipv6.c
index 73fe2bd13fcf..c498aaa8056b 100644
--- a/net/ipv6/netfilter/nft_chain_nat_ipv6.c
+++ b/net/ipv6/netfilter/nft_chain_nat_ipv6.c
@@ -65,7 +65,7 @@ static unsigned int nft_nat_ipv6_local_fn(void *priv,
65 return nf_nat_ipv6_local_fn(priv, skb, state, nft_nat_do_chain); 65 return nf_nat_ipv6_local_fn(priv, skb, state, nft_nat_do_chain);
66} 66}
67 67
68static const struct nf_chain_type nft_chain_nat_ipv6 = { 68static const struct nft_chain_type nft_chain_nat_ipv6 = {
69 .name = "nat", 69 .name = "nat",
70 .type = NFT_CHAIN_T_NAT, 70 .type = NFT_CHAIN_T_NAT,
71 .family = NFPROTO_IPV6, 71 .family = NFPROTO_IPV6,
diff --git a/net/ipv6/netfilter/nft_chain_route_ipv6.c b/net/ipv6/netfilter/nft_chain_route_ipv6.c
index 11d3c3b9aa18..d5c7fdc34256 100644
--- a/net/ipv6/netfilter/nft_chain_route_ipv6.c
+++ b/net/ipv6/netfilter/nft_chain_route_ipv6.c
@@ -60,7 +60,7 @@ static unsigned int nf_route_table_hook(void *priv,
60 return ret; 60 return ret;
61} 61}
62 62
63static const struct nf_chain_type nft_chain_route_ipv6 = { 63static const struct nft_chain_type nft_chain_route_ipv6 = {
64 .name = "route", 64 .name = "route",
65 .type = NFT_CHAIN_T_ROUTE, 65 .type = NFT_CHAIN_T_ROUTE,
66 .family = NFPROTO_IPV6, 66 .family = NFPROTO_IPV6,
diff --git a/net/netfilter/nf_tables_api.c b/net/netfilter/nf_tables_api.c
index 92f5606b0dea..bf564f491085 100644
--- a/net/netfilter/nf_tables_api.c
+++ b/net/netfilter/nf_tables_api.c
@@ -384,9 +384,9 @@ static inline u64 nf_tables_alloc_handle(struct nft_table *table)
384 return ++table->hgenerator; 384 return ++table->hgenerator;
385} 385}
386 386
387static const struct nf_chain_type *chain_type[NFPROTO_NUMPROTO][NFT_CHAIN_T_MAX]; 387static const struct nft_chain_type *chain_type[NFPROTO_NUMPROTO][NFT_CHAIN_T_MAX];
388 388
389static const struct nf_chain_type * 389static const struct nft_chain_type *
390__nf_tables_chain_type_lookup(const struct nlattr *nla, u8 family) 390__nf_tables_chain_type_lookup(const struct nlattr *nla, u8 family)
391{ 391{
392 int i; 392 int i;
@@ -399,10 +399,10 @@ __nf_tables_chain_type_lookup(const struct nlattr *nla, u8 family)
399 return NULL; 399 return NULL;
400} 400}
401 401
402static const struct nf_chain_type * 402static const struct nft_chain_type *
403nf_tables_chain_type_lookup(const struct nlattr *nla, u8 family, bool autoload) 403nf_tables_chain_type_lookup(const struct nlattr *nla, u8 family, bool autoload)
404{ 404{
405 const struct nf_chain_type *type; 405 const struct nft_chain_type *type;
406 406
407 type = __nf_tables_chain_type_lookup(nla, family); 407 type = __nf_tables_chain_type_lookup(nla, family);
408 if (type != NULL) 408 if (type != NULL)
@@ -859,7 +859,7 @@ static void nf_tables_table_destroy(struct nft_ctx *ctx)
859 kfree(ctx->table); 859 kfree(ctx->table);
860} 860}
861 861
862int nft_register_chain_type(const struct nf_chain_type *ctype) 862int nft_register_chain_type(const struct nft_chain_type *ctype)
863{ 863{
864 int err = 0; 864 int err = 0;
865 865
@@ -878,7 +878,7 @@ out:
878} 878}
879EXPORT_SYMBOL_GPL(nft_register_chain_type); 879EXPORT_SYMBOL_GPL(nft_register_chain_type);
880 880
881void nft_unregister_chain_type(const struct nf_chain_type *ctype) 881void nft_unregister_chain_type(const struct nft_chain_type *ctype)
882{ 882{
883 nfnl_lock(NFNL_SUBSYS_NFTABLES); 883 nfnl_lock(NFNL_SUBSYS_NFTABLES);
884 chain_type[ctype->family][ctype->type] = NULL; 884 chain_type[ctype->family][ctype->type] = NULL;
@@ -1239,7 +1239,7 @@ static void nf_tables_chain_destroy(struct nft_chain *chain)
1239struct nft_chain_hook { 1239struct nft_chain_hook {
1240 u32 num; 1240 u32 num;
1241 s32 priority; 1241 s32 priority;
1242 const struct nf_chain_type *type; 1242 const struct nft_chain_type *type;
1243 struct net_device *dev; 1243 struct net_device *dev;
1244}; 1244};
1245 1245
@@ -1249,7 +1249,7 @@ static int nft_chain_parse_hook(struct net *net,
1249 bool create) 1249 bool create)
1250{ 1250{
1251 struct nlattr *ha[NFTA_HOOK_MAX + 1]; 1251 struct nlattr *ha[NFTA_HOOK_MAX + 1];
1252 const struct nf_chain_type *type; 1252 const struct nft_chain_type *type;
1253 struct net_device *dev; 1253 struct net_device *dev;
1254 int err; 1254 int err;
1255 1255
@@ -6000,7 +6000,7 @@ static const struct nfnetlink_subsystem nf_tables_subsys = {
6000}; 6000};
6001 6001
6002int nft_chain_validate_dependency(const struct nft_chain *chain, 6002int nft_chain_validate_dependency(const struct nft_chain *chain,
6003 enum nft_chain_type type) 6003 enum nft_chain_types type)
6004{ 6004{
6005 const struct nft_base_chain *basechain; 6005 const struct nft_base_chain *basechain;
6006 6006
diff --git a/net/netfilter/nf_tables_inet.c b/net/netfilter/nf_tables_inet.c
index e30c7da09d0d..0aefe66ce558 100644
--- a/net/netfilter/nf_tables_inet.c
+++ b/net/netfilter/nf_tables_inet.c
@@ -38,7 +38,7 @@ static unsigned int nft_do_chain_inet(void *priv, struct sk_buff *skb,
38 return nft_do_chain(&pkt, priv); 38 return nft_do_chain(&pkt, priv);
39} 39}
40 40
41static const struct nf_chain_type filter_inet = { 41static const struct nft_chain_type filter_inet = {
42 .name = "filter", 42 .name = "filter",
43 .type = NFT_CHAIN_T_DEFAULT, 43 .type = NFT_CHAIN_T_DEFAULT,
44 .family = NFPROTO_INET, 44 .family = NFPROTO_INET,
diff --git a/net/netfilter/nf_tables_netdev.c b/net/netfilter/nf_tables_netdev.c
index 4041fafca934..88ea959211ac 100644
--- a/net/netfilter/nf_tables_netdev.c
+++ b/net/netfilter/nf_tables_netdev.c
@@ -38,7 +38,7 @@ nft_do_chain_netdev(void *priv, struct sk_buff *skb,
38 return nft_do_chain(&pkt, priv); 38 return nft_do_chain(&pkt, priv);
39} 39}
40 40
41static const struct nf_chain_type nft_filter_chain_netdev = { 41static const struct nft_chain_type nft_filter_chain_netdev = {
42 .name = "filter", 42 .name = "filter",
43 .type = NFT_CHAIN_T_DEFAULT, 43 .type = NFT_CHAIN_T_DEFAULT,
44 .family = NFPROTO_NETDEV, 44 .family = NFPROTO_NETDEV,