netfilter-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jeremy Sowden <jeremy@azazel.net>
To: Pablo Neira Ayuso <pablo@netfilter.org>,
	Jozsef Kadlecsik <kadlec@netfilter.org>,
	Florian Westphal <fw@strlen.de>
Cc: Netfilter Devel <netfilter-devel@vger.kernel.org>
Subject: [PATCH nf-next v2 13/30] netfilter: inline three headers.
Date: Tue,  3 Sep 2019 00:06:33 +0100	[thread overview]
Message-ID: <20190902230650.14621-14-jeremy@azazel.net> (raw)
In-Reply-To: <20190902230650.14621-1-jeremy@azazel.net>

Three netfilter headers are only included once.  Inline their contents
at those sites and remove them.

Signed-off-by: Jeremy Sowden <jeremy@azazel.net>
---
 include/linux/netfilter/xt_hashlimit.h     | 11 -----------
 include/linux/netfilter/xt_physdev.h       |  8 --------
 include/linux/netfilter_bridge/ebt_802_3.h | 12 ------------
 net/bridge/netfilter/ebt_802_3.c           |  8 +++++++-
 net/netfilter/xt_hashlimit.c               |  7 ++++++-
 net/netfilter/xt_physdev.c                 |  5 +++--
 6 files changed, 16 insertions(+), 35 deletions(-)
 delete mode 100644 include/linux/netfilter/xt_hashlimit.h
 delete mode 100644 include/linux/netfilter/xt_physdev.h
 delete mode 100644 include/linux/netfilter_bridge/ebt_802_3.h

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 @@
-/* SPDX-License-Identifier: GPL-2.0 */
-#ifndef _XT_HASHLIMIT_H
-#define _XT_HASHLIMIT_H
-
-#include <uapi/linux/netfilter/xt_hashlimit.h>
-
-#define XT_HASHLIMIT_ALL (XT_HASHLIMIT_HASH_DIP | XT_HASHLIMIT_HASH_DPT | \
-			  XT_HASHLIMIT_HASH_SIP | XT_HASHLIMIT_HASH_SPT | \
-			  XT_HASHLIMIT_INVERT | XT_HASHLIMIT_BYTES |\
-			  XT_HASHLIMIT_RATE_MATCH)
-#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 @@
-/* SPDX-License-Identifier: GPL-2.0 */
-#ifndef _XT_PHYSDEV_H
-#define _XT_PHYSDEV_H
-
-#include <linux/if.h>
-#include <uapi/linux/netfilter/xt_physdev.h>
-
-#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 @@
-/* SPDX-License-Identifier: GPL-2.0 */
-#ifndef __LINUX_BRIDGE_EBT_802_3_H
-#define __LINUX_BRIDGE_EBT_802_3_H
-
-#include <linux/skbuff.h>
-#include <uapi/linux/netfilter_bridge/ebt_802_3.h>
-
-static inline struct ebt_802_3_hdr *ebt_802_3_hdr(const struct sk_buff *skb)
-{
-	return (struct ebt_802_3_hdr *)skb_mac_header(skb);
-}
-#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 @@
 #include <linux/module.h>
 #include <linux/netfilter/x_tables.h>
 #include <linux/netfilter_bridge/ebtables.h>
-#include <linux/netfilter_bridge/ebt_802_3.h>
+#include <linux/skbuff.h>
+#include <uapi/linux/netfilter_bridge/ebt_802_3.h>
+
+static struct ebt_802_3_hdr *ebt_802_3_hdr(const struct sk_buff *skb)
+{
+	return (struct ebt_802_3_hdr *)skb_mac_header(skb);
+}
 
 static bool
 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 @@
 #include <linux/netfilter/x_tables.h>
 #include <linux/netfilter_ipv4/ip_tables.h>
 #include <linux/netfilter_ipv6/ip6_tables.h>
-#include <linux/netfilter/xt_hashlimit.h>
 #include <linux/mutex.h>
 #include <linux/kernel.h>
+#include <uapi/linux/netfilter/xt_hashlimit.h>
+
+#define XT_HASHLIMIT_ALL (XT_HASHLIMIT_HASH_DIP | XT_HASHLIMIT_HASH_DPT | \
+			  XT_HASHLIMIT_HASH_SIP | XT_HASHLIMIT_HASH_SPT | \
+			  XT_HASHLIMIT_INVERT | XT_HASHLIMIT_BYTES |\
+			  XT_HASHLIMIT_RATE_MATCH)
 
 MODULE_LICENSE("GPL");
 MODULE_AUTHOR("Harald Welte <laforge@netfilter.org>");
diff --git a/net/netfilter/xt_physdev.c b/net/netfilter/xt_physdev.c
index 4f311e5703e8..559a0572557f 100644
--- a/net/netfilter/xt_physdev.c
+++ b/net/netfilter/xt_physdev.c
@@ -5,11 +5,13 @@
 /* (C) 2001-2003 Bart De Schuymer <bdschuym@pandora.be>
  */
 #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
+
+#include <linux/if.h>
 #include <linux/module.h>
 #include <linux/skbuff.h>
 #include <linux/netfilter_bridge.h>
-#include <linux/netfilter/xt_physdev.h>
 #include <linux/netfilter/x_tables.h>
+#include <uapi/linux/netfilter/xt_physdev.h>
 
 MODULE_LICENSE("GPL");
 MODULE_AUTHOR("Bart De Schuymer <bdschuym@pandora.be>");
@@ -17,7 +19,6 @@ MODULE_DESCRIPTION("Xtables: Bridge physical device match");
 MODULE_ALIAS("ipt_physdev");
 MODULE_ALIAS("ip6t_physdev");
 
-
 static bool
 physdev_mt(const struct sk_buff *skb, struct xt_action_param *par)
 {
-- 
2.23.0.rc1


  parent reply	other threads:[~2019-09-02 23:32 UTC|newest]

Thread overview: 35+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-09-02 23:06 [PATCH nf-next v2 00/30] Add config option checks to netfilter headers Jeremy Sowden
2019-09-02 23:06 ` [PATCH nf-next v2 01/30] netfilter: add include guard to nf_conntrack_h323_types.h Jeremy Sowden
2019-09-02 23:06 ` [PATCH nf-next v2 02/30] netfilter: add include guard to nf_conntrack_labels.h Jeremy Sowden
2019-09-02 23:06 ` [PATCH nf-next v2 03/30] netfilter: fix include guard comment Jeremy Sowden
2019-09-02 23:06 ` [PATCH nf-next v2 04/30] netfilter: add GPL-2.0 SPDX ID's to a couple of headers Jeremy Sowden
2019-09-02 23:06 ` [PATCH nf-next v2 05/30] netfilter: remove trailing white-space Jeremy Sowden
2019-09-02 23:06 ` [PATCH nf-next v2 06/30] netfilter: fix Kconfig formatting error Jeremy Sowden
2019-09-02 23:06 ` [PATCH nf-next v2 07/30] netfilter: remove stray semicolons Jeremy Sowden
2019-09-02 23:06 ` [PATCH nf-next v2 08/30] netfilter: remove unused function declarations Jeremy Sowden
2019-09-02 23:06 ` [PATCH nf-next v2 09/30] netfilter: remove unused includes Jeremy Sowden
2019-09-02 23:06 ` [PATCH nf-next v2 10/30] netfilter: include the right header in nf_conntrack_zones.h Jeremy Sowden
2019-09-02 23:06 ` [PATCH nf-next v2 11/30] netfilter: fix inclusions of <linux/netfilter/nf_nat.h> Jeremy Sowden
2019-09-02 23:06 ` [PATCH nf-next v2 12/30] netfilter: added missing includes Jeremy Sowden
2019-09-02 23:06 ` Jeremy Sowden [this message]
2019-09-02 23:06 ` [PATCH nf-next v2 14/30] netfilter: remove superfluous header Jeremy Sowden
2019-09-02 23:06 ` [PATCH nf-next v2 15/30] netfilter: move inline function to a more appropriate header Jeremy Sowden
2019-09-02 23:06 ` [PATCH nf-next v2 16/30] netfilter: move code between synproxy headers Jeremy Sowden
2019-09-02 23:06 ` [PATCH nf-next v2 17/30] netfilter: move struct definition function to a more appropriate header Jeremy Sowden
2019-09-02 23:06 ` [PATCH nf-next v2 18/30] netfilter: use consistent style when defining inline functions in nf_conntrack_ecache.h Jeremy Sowden
2019-09-02 23:06 ` [PATCH nf-next v2 19/30] netfilter: replace defined(CONFIG...) || defined(CONFIG...MODULE) with IS_ENABLED(CONFIG...) Jeremy Sowden
2019-09-02 23:06 ` [PATCH nf-next v2 20/30] netfilter: wrap union nf_conntrack_proto members in CONFIG_NF_CT_PROTO_* check Jeremy Sowden
2019-09-02 23:06 ` [PATCH nf-next v2 21/30] netfilter: wrap inline synproxy function in CONFIG_NETFILTER_SYNPROXY check Jeremy Sowden
2019-09-02 23:06 ` [PATCH nf-next v2 22/30] netfilter: wrap inline timeout function in CONFIG_NETFILTER_TIMEOUT check Jeremy Sowden
2019-09-02 23:06 ` [PATCH nf-next v2 23/30] netfilter: wrap some nat-related conntrack code in a CONFIG_NF_NAT check Jeremy Sowden
2019-09-02 23:06 ` [PATCH nf-next v2 24/30] netfilter: wrap some ipv6 tables code in a CONFIG_NF_TABLES_IPV6 check Jeremy Sowden
2019-09-02 23:06 ` [PATCH nf-next v2 25/30] netfilter: wrap some conntrack code in a CONFIG_NF_CONNTRACK check Jeremy Sowden
2019-09-02 23:06 ` [PATCH nf-next v2 26/30] netfilter: add CONFIG_NETFILTER check to linux/netfilter.h Jeremy Sowden
2019-09-02 23:06 ` [PATCH nf-next v2 27/30] netfilter: add NF_TPROXY config option Jeremy Sowden
2019-09-02 23:06 ` [PATCH nf-next v2 28/30] netfilter: add IP_SET_BITMAP " Jeremy Sowden
2019-09-02 23:06 ` [PATCH nf-next v2 29/30] netfilter: add IP_SET_HASH " Jeremy Sowden
2019-09-02 23:06 ` [PATCH nf-next v2 30/30] netfilter: wrap headers in CONFIG checks Jeremy Sowden
2019-09-04 13:50   ` kbuild test robot
2019-09-04 19:05 ` [PATCH nf-next v2 00/30] Add config option checks to netfilter headers Pablo Neira Ayuso
2019-09-07 19:16   ` Jeremy Sowden
2019-09-08 18:14     ` Pablo Neira Ayuso

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190902230650.14621-14-jeremy@azazel.net \
    --to=jeremy@azazel.net \
    --cc=fw@strlen.de \
    --cc=kadlec@netfilter.org \
    --cc=netfilter-devel@vger.kernel.org \
    --cc=pablo@netfilter.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).