* [PATCH nf-next] netfilter: fix compilation with !CONFIG_NF_CONNTRACK
@ 2016-10-31 11:53 Pablo Neira Ayuso
0 siblings, 0 replies; only message in thread
From: Pablo Neira Ayuso @ 2016-10-31 11:53 UTC (permalink / raw)
To: netfilter-devel
With no conntrack support, struct nf_conntrack becomes undefined in
linux/skbuff.h.
Wrap around #include <net/netfilter/nf_conntrack.h> in ifdefs as we do
already in other spots in this code.
All errors (new ones prefixed by >>):
In file included from net/ipv4/netfilter/nf_socket_ipv4.c:19:0:
>> include/net/netfilter/nf_conntrack.h:83:22: error: field 'ct_general' has incomplete type
struct nf_conntrack ct_general;
^~~~~~~~~~
include/net/netfilter/nf_conntrack.h: In function 'nf_ct_get':
>> include/net/netfilter/nf_conntrack.h:170:30: error: 'const struct sk_buff' has no member named 'nfct'; did you mean 'next'?
return (struct nf_conn *)skb->nfct;
^~
include/net/netfilter/nf_conntrack.h: In function 'nf_ct_put':
>> include/net/netfilter/nf_conntrack.h:177:2: error: implicit declaration of function 'nf_conntrack_put' [-Werror=implicit-function-declaration]
nf_conntrack_put(&ct->ct_general);
^~~~~~~~~~~~~~~~
cc1: some warnings being treated as errors
Reported-by: kbuild test robot <fengguang.wu@intel.com>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
---
net/ipv4/netfilter/nf_socket_ipv4.c | 2 ++
net/ipv6/netfilter/nf_socket_ipv6.c | 2 ++
2 files changed, 4 insertions(+)
diff --git a/net/ipv4/netfilter/nf_socket_ipv4.c b/net/ipv4/netfilter/nf_socket_ipv4.c
index 5f3741ba4654..a83d558e1aae 100644
--- a/net/ipv4/netfilter/nf_socket_ipv4.c
+++ b/net/ipv4/netfilter/nf_socket_ipv4.c
@@ -16,7 +16,9 @@
#include <net/sock.h>
#include <net/inet_sock.h>
#include <net/netfilter/nf_socket.h>
+#if IS_ENABLED(CONFIG_NF_CONNTRACK)
#include <net/netfilter/nf_conntrack.h>
+#endif
static int
extract_icmp4_fields(const struct sk_buff *skb, u8 *protocol,
diff --git a/net/ipv6/netfilter/nf_socket_ipv6.c b/net/ipv6/netfilter/nf_socket_ipv6.c
index 95cb0b82ff9a..ebb2bf84232a 100644
--- a/net/ipv6/netfilter/nf_socket_ipv6.c
+++ b/net/ipv6/netfilter/nf_socket_ipv6.c
@@ -18,7 +18,9 @@
#include <net/inet6_hashtables.h>
#include <net/netfilter/ipv6/nf_defrag_ipv6.h>
#include <net/netfilter/nf_socket.h>
+#if IS_ENABLED(CONFIG_NF_CONNTRACK)
#include <net/netfilter/nf_conntrack.h>
+#endif
static int
extract_icmp6_fields(const struct sk_buff *skb,
--
2.1.4
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2016-10-31 11:54 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-10-31 11:53 [PATCH nf-next] netfilter: fix compilation with !CONFIG_NF_CONNTRACK Pablo Neira Ayuso
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).