From: Mikko Rapeli <mikko.rapeli@iki.fi>
To: Davide Caratti <dcaratti@redhat.com>
Cc: Alexey Kuznetsov <kuznet@ms2.inr.ac.ru>,
"David S . Miller" <davem@davemloft.net>,
Florian Westphal <fw@strlen.de>,
Hideaki YOSHIFUJI <yoshfuji@linux-ipv6.org>,
James Morris <jmorris@namei.org>,
Jozsef Kadlecsik <kadlec@blackhole.kfki.hu>,
Pablo Neira Ayuso <pablo@netfilter.org>,
Patrick McHardy <kaber@trash.net>,
coreteam@netfilter.org, netfilter-devel@vger.kernel.org
Subject: Re: [PATCH nf-next 1/4] netfilter: nf_conntrack_tuple_common.h: fix #include
Date: Fri, 11 Nov 2016 12:07:38 +0200 [thread overview]
Message-ID: <20161111100738.GF8342@lakka.kapsi.fi> (raw)
In-Reply-To: <76156fa3b39eba2d1d6739a47d40a99920acd802.1478784737.git.dcaratti@redhat.com>
Hi,
On Thu, Nov 10, 2016 at 03:46:25PM +0100, Davide Caratti wrote:
> In commit 1ffad83dffd6 ("netfilter: fix include files for compilation"),
> compile-time errors were fixed for userspace programs including UAPI
> nf_conntrack_tuple_common.h: this was done by adding a "#include
> <linux/netfilter.h>" line to that header file. This patch replaces
> "<linux/netfilter.h>" with "<linux/netfilter/nf_conntrack_common.h>"
> in nf_conntrack_tuple_common.h to avoid compile-time errors when trying
> to use enum ip_conntrack_dir in include/net/netns/conntrack.h, and still
> correctly resolve IP_CT_IS_REPLY.
I assume also with this change it is ok to include both <linux/netfilter.h>
and <linux/netfilter/nf_conntrack_tuple_common.h> userspace but what was the
kernel compile error with include/net/netns/conntrack.h and ip_conntrack_dir?
Is there a kernel side conflict between uapi and net/netns headers?
Could the fix be confined into the kernel side private headers somehow to avoid
changes visible to userspace?
I kind of like the pattern that netfilter uapi headers include
<linux/netfilter.h> and get what they need from there. Maybe maintainers
disagree though.
-Mikko
> This accidentally fixes two failures in the output of the script used to
> test the above commit [1]:
>
> $ pushd usr/include
> $ ../../scripts/headers_compile_test.sh -k | grep FAILED >before.txt
> $ sed -i s/netfilter.h/netfilter\/nf_conntrack_common.h/1 \
> linux/netfilter/nf_conntrack_tuple_common.h
> $ ../../scripts/headers_compile_test.sh -k | grep FAILED >after.txt
> $ diff before.txt after.txt
> 24,25d23
> < FAILED: ./linux/netfilter/nf_conntrack_sctp.h
> < FAILED: ./linux/netfilter/nf_conntrack_tuple_common.h
> $ popd
>
> [1] https://github.com/mcfrisk/linux/blob/headers_test_v05/scripts/headers_compile_test.sh
>
> Signed-off-by: Davide Caratti <dcaratti@redhat.com>
> ---
> include/uapi/linux/netfilter/nf_conntrack_tuple_common.h | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/include/uapi/linux/netfilter/nf_conntrack_tuple_common.h b/include/uapi/linux/netfilter/nf_conntrack_tuple_common.h
> index a9c3834..941e8ea 100644
> --- a/include/uapi/linux/netfilter/nf_conntrack_tuple_common.h
> +++ b/include/uapi/linux/netfilter/nf_conntrack_tuple_common.h
> @@ -2,7 +2,7 @@
> #define _NF_CONNTRACK_TUPLE_COMMON_H
>
> #include <linux/types.h>
> -#include <linux/netfilter.h>
> +#include <linux/netfilter/nf_conntrack_common.h>
>
> enum ip_conntrack_dir {
> IP_CT_DIR_ORIGINAL,
> --
> 2.7.4
>
next prev parent reply other threads:[~2016-11-11 10:08 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-11-10 14:46 [PATCH nf-next 0/4] netfilter: built-in conntrack support for DCCP, SCTP, UDPlite Davide Caratti
2016-11-10 14:46 ` [PATCH nf-next 1/4] netfilter: nf_conntrack_tuple_common.h: fix #include Davide Caratti
2016-11-11 10:07 ` Mikko Rapeli [this message]
2016-11-11 12:02 ` Davide Caratti
2016-11-14 14:01 ` Davide Caratti
2016-11-14 17:59 ` mikko.rapeli
2016-11-10 14:46 ` [PATCH nf-next 2/4] netfilter: conntrack: built-in support for DCCP Davide Caratti
2016-11-10 14:46 ` [PATCH nf-next 3/4] netfilter: conntrack: built-in support for SCTP Davide Caratti
2016-11-10 14:46 ` [PATCH nf-next 4/4] netfilter: conntrack: built-in support for UDPlite Davide Caratti
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=20161111100738.GF8342@lakka.kapsi.fi \
--to=mikko.rapeli@iki.fi \
--cc=coreteam@netfilter.org \
--cc=davem@davemloft.net \
--cc=dcaratti@redhat.com \
--cc=fw@strlen.de \
--cc=jmorris@namei.org \
--cc=kaber@trash.net \
--cc=kadlec@blackhole.kfki.hu \
--cc=kuznet@ms2.inr.ac.ru \
--cc=netfilter-devel@vger.kernel.org \
--cc=pablo@netfilter.org \
--cc=yoshfuji@linux-ipv6.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.