diff options
| -rw-r--r-- | include/net/netfilter/nf_tables_core.h | 1 | ||||
| -rw-r--r-- | net/netfilter/Kconfig | 6 | ||||
| -rw-r--r-- | net/netfilter/Makefile | 3 | ||||
| -rw-r--r-- | net/netfilter/nf_tables_core.c | 1 | ||||
| -rw-r--r-- | net/netfilter/nft_rt.c | 22 |
5 files changed, 4 insertions, 29 deletions
diff --git a/include/net/netfilter/nf_tables_core.h b/include/net/netfilter/nf_tables_core.h index 3339cce8f585..d6a358ae3749 100644 --- a/include/net/netfilter/nf_tables_core.h +++ b/include/net/netfilter/nf_tables_core.h | |||
| @@ -11,6 +11,7 @@ extern struct nft_expr_type nft_payload_type; | |||
| 11 | extern struct nft_expr_type nft_dynset_type; | 11 | extern struct nft_expr_type nft_dynset_type; |
| 12 | extern struct nft_expr_type nft_range_type; | 12 | extern struct nft_expr_type nft_range_type; |
| 13 | extern struct nft_expr_type nft_meta_type; | 13 | extern struct nft_expr_type nft_meta_type; |
| 14 | extern struct nft_expr_type nft_rt_type; | ||
| 14 | 15 | ||
| 15 | int nf_tables_core_module_init(void); | 16 | int nf_tables_core_module_init(void); |
| 16 | void nf_tables_core_module_exit(void); | 17 | void nf_tables_core_module_exit(void); |
diff --git a/net/netfilter/Kconfig b/net/netfilter/Kconfig index 29a13c7a5af2..771f1a4f3376 100644 --- a/net/netfilter/Kconfig +++ b/net/netfilter/Kconfig | |||
| @@ -480,12 +480,6 @@ config NFT_EXTHDR | |||
| 480 | This option adds the "exthdr" expression that you can use to match | 480 | This option adds the "exthdr" expression that you can use to match |
| 481 | IPv6 extension headers and tcp options. | 481 | IPv6 extension headers and tcp options. |
| 482 | 482 | ||
| 483 | config NFT_RT | ||
| 484 | tristate "Netfilter nf_tables routing module" | ||
| 485 | help | ||
| 486 | This option adds the "rt" expression that you can use to match | ||
| 487 | packet routing information such as the packet nexthop. | ||
| 488 | |||
| 489 | config NFT_NUMGEN | 483 | config NFT_NUMGEN |
| 490 | tristate "Netfilter nf_tables number generator module" | 484 | tristate "Netfilter nf_tables number generator module" |
| 491 | help | 485 | help |
diff --git a/net/netfilter/Makefile b/net/netfilter/Makefile index 89634c389fe7..128dbcfaa194 100644 --- a/net/netfilter/Makefile +++ b/net/netfilter/Makefile | |||
| @@ -76,12 +76,11 @@ obj-$(CONFIG_NF_DUP_NETDEV) += nf_dup_netdev.o | |||
| 76 | nf_tables-objs := nf_tables_core.o nf_tables_api.o nft_chain_filter.o \ | 76 | nf_tables-objs := nf_tables_core.o nf_tables_api.o nft_chain_filter.o \ |
| 77 | nf_tables_trace.o nft_immediate.o nft_cmp.o nft_range.o \ | 77 | nf_tables_trace.o nft_immediate.o nft_cmp.o nft_range.o \ |
| 78 | nft_bitwise.o nft_byteorder.o nft_payload.o nft_lookup.o \ | 78 | nft_bitwise.o nft_byteorder.o nft_payload.o nft_lookup.o \ |
| 79 | nft_dynset.o nft_meta.o | 79 | nft_dynset.o nft_meta.o nft_rt.o |
| 80 | 80 | ||
| 81 | obj-$(CONFIG_NF_TABLES) += nf_tables.o | 81 | obj-$(CONFIG_NF_TABLES) += nf_tables.o |
| 82 | obj-$(CONFIG_NFT_COMPAT) += nft_compat.o | 82 | obj-$(CONFIG_NFT_COMPAT) += nft_compat.o |
| 83 | obj-$(CONFIG_NFT_EXTHDR) += nft_exthdr.o | 83 | obj-$(CONFIG_NFT_EXTHDR) += nft_exthdr.o |
| 84 | obj-$(CONFIG_NFT_RT) += nft_rt.o | ||
| 85 | obj-$(CONFIG_NFT_NUMGEN) += nft_numgen.o | 84 | obj-$(CONFIG_NFT_NUMGEN) += nft_numgen.o |
| 86 | obj-$(CONFIG_NFT_CT) += nft_ct.o | 85 | obj-$(CONFIG_NFT_CT) += nft_ct.o |
| 87 | obj-$(CONFIG_NFT_FLOW_OFFLOAD) += nft_flow_offload.o | 86 | obj-$(CONFIG_NFT_FLOW_OFFLOAD) += nft_flow_offload.o |
diff --git a/net/netfilter/nf_tables_core.c b/net/netfilter/nf_tables_core.c index b67d6577f767..481ce2c0bbbf 100644 --- a/net/netfilter/nf_tables_core.c +++ b/net/netfilter/nf_tables_core.c | |||
| @@ -252,6 +252,7 @@ static struct nft_expr_type *nft_basic_types[] = { | |||
| 252 | &nft_dynset_type, | 252 | &nft_dynset_type, |
| 253 | &nft_range_type, | 253 | &nft_range_type, |
| 254 | &nft_meta_type, | 254 | &nft_meta_type, |
| 255 | &nft_rt_type, | ||
| 255 | }; | 256 | }; |
| 256 | 257 | ||
| 257 | int __init nf_tables_core_module_init(void) | 258 | int __init nf_tables_core_module_init(void) |
diff --git a/net/netfilter/nft_rt.c b/net/netfilter/nft_rt.c index 11a2071b6dd4..76dba9f6b6f6 100644 --- a/net/netfilter/nft_rt.c +++ b/net/netfilter/nft_rt.c | |||
| @@ -7,8 +7,6 @@ | |||
| 7 | */ | 7 | */ |
| 8 | 8 | ||
| 9 | #include <linux/kernel.h> | 9 | #include <linux/kernel.h> |
| 10 | #include <linux/init.h> | ||
| 11 | #include <linux/module.h> | ||
| 12 | #include <linux/netlink.h> | 10 | #include <linux/netlink.h> |
| 13 | #include <linux/netfilter.h> | 11 | #include <linux/netfilter.h> |
| 14 | #include <linux/netfilter/nf_tables.h> | 12 | #include <linux/netfilter/nf_tables.h> |
| @@ -179,7 +177,6 @@ static int nft_rt_validate(const struct nft_ctx *ctx, const struct nft_expr *exp | |||
| 179 | return nft_chain_validate_hooks(ctx->chain, hooks); | 177 | return nft_chain_validate_hooks(ctx->chain, hooks); |
| 180 | } | 178 | } |
| 181 | 179 | ||
| 182 | static struct nft_expr_type nft_rt_type; | ||
| 183 | static const struct nft_expr_ops nft_rt_get_ops = { | 180 | static const struct nft_expr_ops nft_rt_get_ops = { |
| 184 | .type = &nft_rt_type, | 181 | .type = &nft_rt_type, |
| 185 | .size = NFT_EXPR_SIZE(sizeof(struct nft_rt)), | 182 | .size = NFT_EXPR_SIZE(sizeof(struct nft_rt)), |
| @@ -189,27 +186,10 @@ static const struct nft_expr_ops nft_rt_get_ops = { | |||
| 189 | .validate = nft_rt_validate, | 186 | .validate = nft_rt_validate, |
| 190 | }; | 187 | }; |
| 191 | 188 | ||
| 192 | static struct nft_expr_type nft_rt_type __read_mostly = { | 189 | struct nft_expr_type nft_rt_type __read_mostly = { |
| 193 | .name = "rt", | 190 | .name = "rt", |
| 194 | .ops = &nft_rt_get_ops, | 191 | .ops = &nft_rt_get_ops, |
| 195 | .policy = nft_rt_policy, | 192 | .policy = nft_rt_policy, |
| 196 | .maxattr = NFTA_RT_MAX, | 193 | .maxattr = NFTA_RT_MAX, |
| 197 | .owner = THIS_MODULE, | 194 | .owner = THIS_MODULE, |
| 198 | }; | 195 | }; |
| 199 | |||
| 200 | static int __init nft_rt_module_init(void) | ||
| 201 | { | ||
| 202 | return nft_register_expr(&nft_rt_type); | ||
| 203 | } | ||
| 204 | |||
| 205 | static void __exit nft_rt_module_exit(void) | ||
| 206 | { | ||
| 207 | nft_unregister_expr(&nft_rt_type); | ||
| 208 | } | ||
| 209 | |||
| 210 | module_init(nft_rt_module_init); | ||
| 211 | module_exit(nft_rt_module_exit); | ||
| 212 | |||
| 213 | MODULE_LICENSE("GPL"); | ||
| 214 | MODULE_AUTHOR("Anders K. Pedersen <akp@cohaesio.com>"); | ||
| 215 | MODULE_ALIAS_NFT_EXPR("rt"); | ||
