From: Pablo Neira Ayuso <pablo@netfilter.org>
To: Duncan Roe <duncan_roe@optusnet.com.au>
Cc: netfilter-devel@vger.kernel.org
Subject: Re: [PATCH libnetfilter_queue v2] src: examples: Use libnetfilter_queue cached linux headers throughout
Date: Wed, 7 Jul 2021 00:52:31 +0200 [thread overview]
Message-ID: <20210706225231.GB12859@salvia> (raw)
In-Reply-To: <20210706053648.11109-1-duncan_roe@optusnet.com.au>
On Tue, Jul 06, 2021 at 03:36:48PM +1000, Duncan Roe wrote:
> A user will typically copy nf-queue.c, make changes and compile: picking up
> /usr/include/linux/nfnetlink_queue.h rather than
> /usr/include/libnetfilter_queue/linux_nfnetlink_queue.h as is recommended.
>
> libnetfilter_queue.h already includes linux_nfnetlink_queue.h so we only need
> to delete the errant line.
>
> (Running `make nf-queue` from within libnetfilter_queue/examples will get
> the private cached version of nfnetlink_queue.h which is not distributed).
>
> Signed-off-by: Duncan Roe <duncan_roe@optusnet.com.au>
> ---
> v2: Don't insert a new #include
> Doesn't clash with other nearby patch
> examples/nf-queue.c | 1 -
> 1 file changed, 1 deletion(-)
>
> diff --git a/examples/nf-queue.c b/examples/nf-queue.c
> index 3da2c24..e4b33b5 100644
> --- a/examples/nf-queue.c
> +++ b/examples/nf-queue.c
> @@ -11,7 +11,6 @@
> #include <linux/netfilter/nfnetlink.h>
>
> #include <linux/types.h>
> -#include <linux/netfilter/nfnetlink_queue.h>
I remember now what the intention was.
This include is fine as is: new applications should cache a copy of
nfnetlink_queue.h in their own tree, that's the recommended way to go.
This is the approach that we follow in other existing userspace
netfilter codebase (ie. the userspace program caches the kernel UAPI
header in the tree). The linux_nfnetlink_queue.h header is a legacy
file only for backward compatibility, it should not be used for new
software. This is not documented, the use of this include in
examples/nf-queue.c was intentional.
This approach also allows to fall back to the UAPI kernel headers that
are installed in your system.
Thanks.
next prev parent reply other threads:[~2021-07-06 22:52 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-07-04 23:45 Documentation question Duncan Roe
2021-07-05 8:56 ` Pablo Neira Ayuso
2021-07-05 13:13 ` Duncan Roe
2021-07-05 14:42 ` Pablo Neira Ayuso
2021-07-06 4:27 ` [PATCH libnetfilter_queue] src: examples: Use libnetfilter_queue cached linux headers throughout Duncan Roe
2021-07-06 5:36 ` [PATCH libnetfilter_queue v2] " Duncan Roe
2021-07-06 22:52 ` Pablo Neira Ayuso [this message]
2021-07-07 1:58 ` Duncan Roe
2021-07-18 5:27 ` Duncan Roe
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=20210706225231.GB12859@salvia \
--to=pablo@netfilter.org \
--cc=duncan_roe@optusnet.com.au \
--cc=netfilter-devel@vger.kernel.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).