From: Jeremy Sowden <jeremy@azazel.net>
To: Pablo Neira Ayuso <pablo@netfilter.org>
Cc: Netfilter Devel <netfilter-devel@vger.kernel.org>,
Net Dev <netdev@vger.kernel.org>,
Masahiro Yamada <yamada.masahiro@socionext.com>
Subject: [PATCH net-next v1 3/8] netfilter: added missing IS_ENABLED(CONFIG_BRIDGE_NETFILTER) checks to header-file.
Date: Wed, 7 Aug 2019 15:17:00 +0100 [thread overview]
Message-ID: <20190807141705.4864-4-jeremy@azazel.net> (raw)
In-Reply-To: <20190807141705.4864-1-jeremy@azazel.net>
br_netfilter.h defines inline functions that use an enum constant and
struct member that are only defined if CONFIG_BRIDGE_NETFILTER is
enabled. Added preprocessor checks to ensure br_netfilter.h will
compile if CONFIG_BRIDGE_NETFILTER is disabled.
Signed-off-by: Jeremy Sowden <jeremy@azazel.net>
---
include/net/netfilter/br_netfilter.h | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/include/net/netfilter/br_netfilter.h b/include/net/netfilter/br_netfilter.h
index ca121ed906df..33533ea852a1 100644
--- a/include/net/netfilter/br_netfilter.h
+++ b/include/net/netfilter/br_netfilter.h
@@ -8,12 +8,16 @@
static inline struct nf_bridge_info *nf_bridge_alloc(struct sk_buff *skb)
{
+#if IS_ENABLED(CONFIG_BRIDGE_NETFILTER)
struct nf_bridge_info *b = skb_ext_add(skb, SKB_EXT_BRIDGE_NF);
if (b)
memset(b, 0, sizeof(*b));
return b;
+#else
+ return NULL;
+#endif
}
void nf_bridge_update_protocol(struct sk_buff *skb);
@@ -38,10 +42,14 @@ int br_nf_pre_routing_finish_bridge(struct net *net, struct sock *sk, struct sk_
static inline struct rtable *bridge_parent_rtable(const struct net_device *dev)
{
+#if IS_ENABLED(CONFIG_BRIDGE_NETFILTER)
struct net_bridge_port *port;
port = br_port_get_rcu(dev);
return port ? &port->br->fake_rtable : NULL;
+#else
+ return NULL;
+#endif
}
struct net_device *setup_pre_routing(struct sk_buff *skb,
--
2.20.1
next prev parent reply other threads:[~2019-08-07 14:17 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20190722201615.GE23346@azazel.net>
2019-08-07 14:16 ` [PATCH net-next v1 0/8] netfilter: header compilation fixes Jeremy Sowden
2019-08-07 14:16 ` [PATCH net-next v1 1/8] netfilter: inlined four headers files into another one Jeremy Sowden
2019-08-08 11:23 ` Pablo Neira Ayuso
2019-08-08 20:10 ` Jeremy Sowden
2019-08-08 18:49 ` Jozsef Kadlecsik
2019-08-07 14:16 ` [PATCH net-next v1 2/8] netfilter: added missing includes to a number of header-files Jeremy Sowden
2019-08-07 14:17 ` Jeremy Sowden [this message]
2019-08-07 14:17 ` [PATCH net-next v1 4/8] netfilter: added missing IS_ENABLED(CONFIG_NF_TABLES) check to header-file Jeremy Sowden
2019-08-07 14:17 ` [PATCH net-next v1 5/8] netfilter: added missing IS_ENABLED(CONFIG_NF_CONNTRACK) checks to some header-files Jeremy Sowden
2019-08-07 14:17 ` [PATCH net-next v1 6/8] netfilter: added missing IS_ENABLED(CONFIG_NETFILTER) " Jeremy Sowden
2019-08-07 14:17 ` [PATCH net-next v1 7/8] netfilter: removed "#ifdef __KERNEL__" guards from some headers Jeremy Sowden
2019-08-07 14:17 ` [PATCH net-next v1 8/8] kbuild: removed all netfilter headers from header-test blacklist Jeremy Sowden
2019-08-13 9:55 ` [PATCH net-next v1 0/8] netfilter: header compilation fixes Pablo Neira Ayuso
2019-08-13 10:04 ` Jeremy Sowden
2019-08-13 10:14 ` Pablo Neira Ayuso
2019-08-13 11:36 ` Jeremy Sowden
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=20190807141705.4864-4-jeremy@azazel.net \
--to=jeremy@azazel.net \
--cc=netdev@vger.kernel.org \
--cc=netfilter-devel@vger.kernel.org \
--cc=pablo@netfilter.org \
--cc=yamada.masahiro@socionext.com \
/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).