diff options
author | Jeremy Sowden <jeremy@azazel.net> | 2019-09-13 04:13:04 -0400 |
---|---|---|
committer | Pablo Neira Ayuso <pablo@netfilter.org> | 2019-09-13 06:32:48 -0400 |
commit | 85cfbc25e5c5ee83307aba05eec4b04517890038 (patch) | |
tree | 86e7c395a5b7c2a7773508b56601792e6db52b9d | |
parent | f5d65c197531e9abb7ede82b052459c1a3cf13c3 (diff) |
netfilter: inline xt_hashlimit, ebt_802_3 and xt_physdev headers
Three netfilter headers are only included once. Inline their contents
at those sites and remove them.
Signed-off-by: Jeremy Sowden <jeremy@azazel.net>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
-rw-r--r-- | include/linux/netfilter/xt_hashlimit.h | 11 | ||||
-rw-r--r-- | include/linux/netfilter/xt_physdev.h | 8 | ||||
-rw-r--r-- | include/linux/netfilter_bridge/ebt_802_3.h | 12 | ||||
-rw-r--r-- | net/bridge/netfilter/ebt_802_3.c | 8 | ||||
-rw-r--r-- | net/netfilter/xt_hashlimit.c | 7 | ||||
-rw-r--r-- | net/netfilter/xt_physdev.c | 5 |
6 files changed, 16 insertions, 35 deletions
diff --git a/include/linux/netfilter/xt_hashlimit.h b/include/linux/netfilter/xt_hashlimit.h deleted file mode 100644 index 169d03983589..000000000000 --- a/include/linux/netfilter/xt_hashlimit.h +++ /dev/null | |||
@@ -1,11 +0,0 @@ | |||
1 | /* SPDX-License-Identifier: GPL-2.0 */ | ||
2 | #ifndef _XT_HASHLIMIT_H | ||
3 | #define _XT_HASHLIMIT_H | ||
4 | |||
5 | #include <uapi/linux/netfilter/xt_hashlimit.h> | ||
6 | |||
7 | #define XT_HASHLIMIT_ALL (XT_HASHLIMIT_HASH_DIP | XT_HASHLIMIT_HASH_DPT | \ | ||
8 | XT_HASHLIMIT_HASH_SIP | XT_HASHLIMIT_HASH_SPT | \ | ||
9 | XT_HASHLIMIT_INVERT | XT_HASHLIMIT_BYTES |\ | ||
10 | XT_HASHLIMIT_RATE_MATCH) | ||
11 | #endif /*_XT_HASHLIMIT_H*/ | ||
diff --git a/include/linux/netfilter/xt_physdev.h b/include/linux/netfilter/xt_physdev.h deleted file mode 100644 index 4ca0593949cd..000000000000 --- a/include/linux/netfilter/xt_physdev.h +++ /dev/null | |||
@@ -1,8 +0,0 @@ | |||
1 | /* SPDX-License-Identifier: GPL-2.0 */ | ||
2 | #ifndef _XT_PHYSDEV_H | ||
3 | #define _XT_PHYSDEV_H | ||
4 | |||
5 | #include <linux/if.h> | ||
6 | #include <uapi/linux/netfilter/xt_physdev.h> | ||
7 | |||
8 | #endif /*_XT_PHYSDEV_H*/ | ||
diff --git a/include/linux/netfilter_bridge/ebt_802_3.h b/include/linux/netfilter_bridge/ebt_802_3.h deleted file mode 100644 index c6147f9c0d80..000000000000 --- a/include/linux/netfilter_bridge/ebt_802_3.h +++ /dev/null | |||
@@ -1,12 +0,0 @@ | |||
1 | /* SPDX-License-Identifier: GPL-2.0 */ | ||
2 | #ifndef __LINUX_BRIDGE_EBT_802_3_H | ||
3 | #define __LINUX_BRIDGE_EBT_802_3_H | ||
4 | |||
5 | #include <linux/skbuff.h> | ||
6 | #include <uapi/linux/netfilter_bridge/ebt_802_3.h> | ||
7 | |||
8 | static inline struct ebt_802_3_hdr *ebt_802_3_hdr(const struct sk_buff *skb) | ||
9 | { | ||
10 | return (struct ebt_802_3_hdr *)skb_mac_header(skb); | ||
11 | } | ||
12 | #endif | ||
diff --git a/net/bridge/netfilter/ebt_802_3.c b/net/bridge/netfilter/ebt_802_3.c index 2c8fe24400e5..68c2519bdc52 100644 --- a/net/bridge/netfilter/ebt_802_3.c +++ b/net/bridge/netfilter/ebt_802_3.c | |||
@@ -11,7 +11,13 @@ | |||
11 | #include <linux/module.h> | 11 | #include <linux/module.h> |
12 | #include <linux/netfilter/x_tables.h> | 12 | #include <linux/netfilter/x_tables.h> |
13 | #include <linux/netfilter_bridge/ebtables.h> | 13 | #include <linux/netfilter_bridge/ebtables.h> |
14 | #include <linux/netfilter_bridge/ebt_802_3.h> | 14 | #include <linux/skbuff.h> |
15 | #include <uapi/linux/netfilter_bridge/ebt_802_3.h> | ||
16 | |||
17 | static struct ebt_802_3_hdr *ebt_802_3_hdr(const struct sk_buff *skb) | ||
18 | { | ||
19 | return (struct ebt_802_3_hdr *)skb_mac_header(skb); | ||
20 | } | ||
15 | 21 | ||
16 | static bool | 22 | static bool |
17 | ebt_802_3_mt(const struct sk_buff *skb, struct xt_action_param *par) | 23 | ebt_802_3_mt(const struct sk_buff *skb, struct xt_action_param *par) |
diff --git a/net/netfilter/xt_hashlimit.c b/net/netfilter/xt_hashlimit.c index 2d2691dd51e0..ced3fc8fad7c 100644 --- a/net/netfilter/xt_hashlimit.c +++ b/net/netfilter/xt_hashlimit.c | |||
@@ -34,9 +34,14 @@ | |||
34 | #include <linux/netfilter/x_tables.h> | 34 | #include <linux/netfilter/x_tables.h> |
35 | #include <linux/netfilter_ipv4/ip_tables.h> | 35 | #include <linux/netfilter_ipv4/ip_tables.h> |
36 | #include <linux/netfilter_ipv6/ip6_tables.h> | 36 | #include <linux/netfilter_ipv6/ip6_tables.h> |
37 | #include <linux/netfilter/xt_hashlimit.h> | ||
38 | #include <linux/mutex.h> | 37 | #include <linux/mutex.h> |
39 | #include <linux/kernel.h> | 38 | #include <linux/kernel.h> |
39 | #include <uapi/linux/netfilter/xt_hashlimit.h> | ||
40 | |||
41 | #define XT_HASHLIMIT_ALL (XT_HASHLIMIT_HASH_DIP | XT_HASHLIMIT_HASH_DPT | \ | ||
42 | XT_HASHLIMIT_HASH_SIP | XT_HASHLIMIT_HASH_SPT | \ | ||
43 | XT_HASHLIMIT_INVERT | XT_HASHLIMIT_BYTES |\ | ||
44 | XT_HASHLIMIT_RATE_MATCH) | ||
40 | 45 | ||
41 | MODULE_LICENSE("GPL"); | 46 | MODULE_LICENSE("GPL"); |
42 | MODULE_AUTHOR("Harald Welte <laforge@netfilter.org>"); | 47 | MODULE_AUTHOR("Harald Welte <laforge@netfilter.org>"); |
diff --git a/net/netfilter/xt_physdev.c b/net/netfilter/xt_physdev.c index b92b22ce8abd..ec6ed6fda96c 100644 --- a/net/netfilter/xt_physdev.c +++ b/net/netfilter/xt_physdev.c | |||
@@ -5,12 +5,13 @@ | |||
5 | /* (C) 2001-2003 Bart De Schuymer <bdschuym@pandora.be> | 5 | /* (C) 2001-2003 Bart De Schuymer <bdschuym@pandora.be> |
6 | */ | 6 | */ |
7 | #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt | 7 | #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt |
8 | |||
9 | #include <linux/if.h> | ||
8 | #include <linux/module.h> | 10 | #include <linux/module.h> |
9 | #include <linux/skbuff.h> | 11 | #include <linux/skbuff.h> |
10 | #include <linux/netfilter_bridge.h> | 12 | #include <linux/netfilter_bridge.h> |
11 | #include <linux/netfilter/xt_physdev.h> | ||
12 | #include <linux/netfilter/x_tables.h> | 13 | #include <linux/netfilter/x_tables.h> |
13 | #include <net/netfilter/br_netfilter.h> | 14 | #include <uapi/linux/netfilter/xt_physdev.h> |
14 | 15 | ||
15 | MODULE_LICENSE("GPL"); | 16 | MODULE_LICENSE("GPL"); |
16 | MODULE_AUTHOR("Bart De Schuymer <bdschuym@pandora.be>"); | 17 | MODULE_AUTHOR("Bart De Schuymer <bdschuym@pandora.be>"); |