* [PATCH libnetfilter_queue] include: deprecate libnetfilter_queue/linux_nfnetlink_queue.h
@ 2021-08-10 16:08 Pablo Neira Ayuso
2021-08-11 6:21 ` Duncan Roe
0 siblings, 1 reply; 6+ messages in thread
From: Pablo Neira Ayuso @ 2021-08-10 16:08 UTC (permalink / raw)
To: netfilter-devel; +Cc: duncan_roe
Emit a warning to notify users that this file is deprecated.
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
---
include/libnetfilter_queue/libnetfilter_queue.h | 2 --
include/libnetfilter_queue/linux_nfnetlink_queue.h | 2 ++
src/libnetfilter_queue.c | 1 +
utils/nfqnl_test.c | 1 +
4 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/include/libnetfilter_queue/libnetfilter_queue.h b/include/libnetfilter_queue/libnetfilter_queue.h
index a19122f10ec6..42a3a45f27e1 100644
--- a/include/libnetfilter_queue/libnetfilter_queue.h
+++ b/include/libnetfilter_queue/libnetfilter_queue.h
@@ -16,8 +16,6 @@
#include <sys/time.h>
#include <libnfnetlink/libnfnetlink.h>
-#include <libnetfilter_queue/linux_nfnetlink_queue.h>
-
#ifdef __cplusplus
extern "C" {
#endif
diff --git a/include/libnetfilter_queue/linux_nfnetlink_queue.h b/include/libnetfilter_queue/linux_nfnetlink_queue.h
index caa67884482c..84f5d96c0a7b 100644
--- a/include/libnetfilter_queue/linux_nfnetlink_queue.h
+++ b/include/libnetfilter_queue/linux_nfnetlink_queue.h
@@ -1,6 +1,8 @@
#ifndef _NFNETLINK_QUEUE_H
#define _NFNETLINK_QUEUE_H
+#warning "#include <libnetfilter_queue/linux_nfnetlink_queue.h> is deprecated, use #include <linux/netfilter/nfnetlink_queue.h> instead."
+
#ifndef aligned_u64
#define aligned_u64 unsigned long long __attribute__((aligned(8)))
#endif
diff --git a/src/libnetfilter_queue.c b/src/libnetfilter_queue.c
index ef3b21101998..11a4e7c51cc0 100644
--- a/src/libnetfilter_queue.c
+++ b/src/libnetfilter_queue.c
@@ -29,6 +29,7 @@
#include <errno.h>
#include <netinet/in.h>
#include <sys/socket.h>
+#include <linux/netfilter/nfnetlink_queue.h>
#include <libnfnetlink/libnfnetlink.h>
#include <libnetfilter_queue/libnetfilter_queue.h>
diff --git a/utils/nfqnl_test.c b/utils/nfqnl_test.c
index 5e76ffe48cc7..682f3d79d45a 100644
--- a/utils/nfqnl_test.c
+++ b/utils/nfqnl_test.c
@@ -5,6 +5,7 @@
#include <netinet/in.h>
#include <linux/types.h>
#include <linux/netfilter.h> /* for NF_ACCEPT */
+#include <linux/netfilter/nfnetlink_queue.h>
#include <errno.h>
#include <libnetfilter_queue/libnetfilter_queue.h>
--
2.20.1
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH libnetfilter_queue] include: deprecate libnetfilter_queue/linux_nfnetlink_queue.h
2021-08-10 16:08 [PATCH libnetfilter_queue] include: deprecate libnetfilter_queue/linux_nfnetlink_queue.h Pablo Neira Ayuso
@ 2021-08-11 6:21 ` Duncan Roe
2021-08-11 9:02 ` Pablo Neira Ayuso
0 siblings, 1 reply; 6+ messages in thread
From: Duncan Roe @ 2021-08-11 6:21 UTC (permalink / raw)
To: Pablo Neira Ayuso; +Cc: Netfilter Development
Hi Pablo,
On Tue, Aug 10, 2021 at 06:08:13PM +0200, Pablo Neira Ayuso wrote:
> Emit a warning to notify users that this file is deprecated.
>
> Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
> ---
> include/libnetfilter_queue/libnetfilter_queue.h | 2 --
> include/libnetfilter_queue/linux_nfnetlink_queue.h | 2 ++
> src/libnetfilter_queue.c | 1 +
> utils/nfqnl_test.c | 1 +
> 4 files changed, 4 insertions(+), 2 deletions(-)
>
> diff --git a/include/libnetfilter_queue/libnetfilter_queue.h b/include/libnetfilter_queue/libnetfilter_queue.h
> index a19122f10ec6..42a3a45f27e1 100644
> --- a/include/libnetfilter_queue/libnetfilter_queue.h
> +++ b/include/libnetfilter_queue/libnetfilter_queue.h
> @@ -16,8 +16,6 @@
> #include <sys/time.h>
> #include <libnfnetlink/libnfnetlink.h>
>
> -#include <libnetfilter_queue/linux_nfnetlink_queue.h>
> -
> #ifdef __cplusplus
> extern "C" {
> #endif
> diff --git a/include/libnetfilter_queue/linux_nfnetlink_queue.h b/include/libnetfilter_queue/linux_nfnetlink_queue.h
> index caa67884482c..84f5d96c0a7b 100644
> --- a/include/libnetfilter_queue/linux_nfnetlink_queue.h
> +++ b/include/libnetfilter_queue/linux_nfnetlink_queue.h
> @@ -1,6 +1,8 @@
> #ifndef _NFNETLINK_QUEUE_H
> #define _NFNETLINK_QUEUE_H
>
> +#warning "#include <libnetfilter_queue/linux_nfnetlink_queue.h> is deprecated, use #include <linux/netfilter/nfnetlink_queue.h> instead."
> +
> #ifndef aligned_u64
> #define aligned_u64 unsigned long long __attribute__((aligned(8)))
> #endif
> diff --git a/src/libnetfilter_queue.c b/src/libnetfilter_queue.c
> index ef3b21101998..11a4e7c51cc0 100644
> --- a/src/libnetfilter_queue.c
> +++ b/src/libnetfilter_queue.c
> @@ -29,6 +29,7 @@
> #include <errno.h>
> #include <netinet/in.h>
> #include <sys/socket.h>
> +#include <linux/netfilter/nfnetlink_queue.h>
>
> #include <libnfnetlink/libnfnetlink.h>
> #include <libnetfilter_queue/libnetfilter_queue.h>
> diff --git a/utils/nfqnl_test.c b/utils/nfqnl_test.c
> index 5e76ffe48cc7..682f3d79d45a 100644
> --- a/utils/nfqnl_test.c
> +++ b/utils/nfqnl_test.c
> @@ -5,6 +5,7 @@
> #include <netinet/in.h>
> #include <linux/types.h>
> #include <linux/netfilter.h> /* for NF_ACCEPT */
> +#include <linux/netfilter/nfnetlink_queue.h>
> #include <errno.h>
>
> #include <libnetfilter_queue/libnetfilter_queue.h>
> --
> 2.20.1
>
Suggest you leave include/libnetfilter_queue/libnetfilter_queue.h unaltered.
That way, if a user fails to insert linux/netfilter/nfnetlink_queue.h at all, he
will get the warning. With the patched libnetfilter_queue.h, he will get
compilation errors where previously he did not.
Otherwise all good.
BTW if a user doesn't have kernel headers he's in for a hard time anyway: the
verdict helpers need linux/netfilter.h for NF_ACCEPT &c.
Cheers ... Duncan.
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH libnetfilter_queue] include: deprecate libnetfilter_queue/linux_nfnetlink_queue.h
2021-08-11 6:21 ` Duncan Roe
@ 2021-08-11 9:02 ` Pablo Neira Ayuso
2021-08-11 19:06 ` Duncan Roe
0 siblings, 1 reply; 6+ messages in thread
From: Pablo Neira Ayuso @ 2021-08-11 9:02 UTC (permalink / raw)
To: Netfilter Development
On Wed, Aug 11, 2021 at 04:21:40PM +1000, Duncan Roe wrote:
[...]
> Suggest you leave include/libnetfilter_queue/libnetfilter_queue.h unaltered.
>
> That way, if a user fails to insert linux/netfilter/nfnetlink_queue.h at all, he
> will get the warning. With the patched libnetfilter_queue.h, he will get
> compilation errors where previously he did not.
OK, done and pushed it out. Thanks.
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH libnetfilter_queue] include: deprecate libnetfilter_queue/linux_nfnetlink_queue.h
2021-08-11 9:02 ` Pablo Neira Ayuso
@ 2021-08-11 19:06 ` Duncan Roe
2021-08-12 8:20 ` Pablo Neira Ayuso
0 siblings, 1 reply; 6+ messages in thread
From: Duncan Roe @ 2021-08-11 19:06 UTC (permalink / raw)
To: Pablo Neira Ayuso; +Cc: Netfilter Development
On Wed, Aug 11, 2021 at 11:02:03AM +0200, Pablo Neira Ayuso wrote:
> On Wed, Aug 11, 2021 at 04:21:40PM +1000, Duncan Roe wrote:
> [...]
> > Suggest you leave include/libnetfilter_queue/libnetfilter_queue.h unaltered.
> >
> > That way, if a user fails to insert linux/netfilter/nfnetlink_queue.h at all, he
> > will get the warning. With the patched libnetfilter_queue.h, he will get
> > compilation errors where previously he did not.
>
> OK, done and pushed it out. Thanks.
You really didn't need all these extra #include lines. The only source that
doesn't compile with "#include <libnetfilter_queue/linux_nfnetlink_queue.h>"
removed from libnetfilter_queue.h is libnetfilter_queue.c.
So, only src/libnetfilter_queue.c needed
"#include <linux/netfilter/nfnetlink_queue.h>". If in the future any of the
others were changed so nfnetlink_queue.h *was* required, the person doing the
change would get the warning and insert the #include then.
Worth a v2?
Cheers ... Duncan.
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH libnetfilter_queue] include: deprecate libnetfilter_queue/linux_nfnetlink_queue.h
2021-08-11 19:06 ` Duncan Roe
@ 2021-08-12 8:20 ` Pablo Neira Ayuso
2021-08-12 18:25 ` Duncan Roe
0 siblings, 1 reply; 6+ messages in thread
From: Pablo Neira Ayuso @ 2021-08-12 8:20 UTC (permalink / raw)
To: Netfilter Development
On Thu, Aug 12, 2021 at 05:06:11AM +1000, Duncan Roe wrote:
> On Wed, Aug 11, 2021 at 11:02:03AM +0200, Pablo Neira Ayuso wrote:
> > On Wed, Aug 11, 2021 at 04:21:40PM +1000, Duncan Roe wrote:
> > [...]
> > > Suggest you leave include/libnetfilter_queue/libnetfilter_queue.h unaltered.
> > >
> > > That way, if a user fails to insert linux/netfilter/nfnetlink_queue.h at all, he
> > > will get the warning. With the patched libnetfilter_queue.h, he will get
> > > compilation errors where previously he did not.
> >
> > OK, done and pushed it out. Thanks.
>
> You really didn't need all these extra #include lines. The only source that
> doesn't compile with "#include <libnetfilter_queue/linux_nfnetlink_queue.h>"
> removed from libnetfilter_queue.h is libnetfilter_queue.c.
Those are needed, otherwise libnetfilter_queue emits warnings all over
the place.
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH libnetfilter_queue] include: deprecate libnetfilter_queue/linux_nfnetlink_queue.h
2021-08-12 8:20 ` Pablo Neira Ayuso
@ 2021-08-12 18:25 ` Duncan Roe
0 siblings, 0 replies; 6+ messages in thread
From: Duncan Roe @ 2021-08-12 18:25 UTC (permalink / raw)
To: Pablo Neira Ayuso; +Cc: Netfilter Development
On Thu, Aug 12, 2021 at 10:20:55AM +0200, Pablo Neira Ayuso wrote:
> On Thu, Aug 12, 2021 at 05:06:11AM +1000, Duncan Roe wrote:
> > On Wed, Aug 11, 2021 at 11:02:03AM +0200, Pablo Neira Ayuso wrote:
> > > On Wed, Aug 11, 2021 at 04:21:40PM +1000, Duncan Roe wrote:
> > > [...]
> > > > Suggest you leave include/libnetfilter_queue/libnetfilter_queue.h unaltered.
> > > >
> > > > That way, if a user fails to insert linux/netfilter/nfnetlink_queue.h at all, he
> > > > will get the warning. With the patched libnetfilter_queue.h, he will get
> > > > compilation errors where previously he did not.
> > >
> > > OK, done and pushed it out. Thanks.
> >
> > You really didn't need all these extra #include lines. The only source that
> > doesn't compile with "#include <libnetfilter_queue/linux_nfnetlink_queue.h>"
> > removed from libnetfilter_queue.h is libnetfilter_queue.c.
>
> Those are needed, otherwise libnetfilter_queue emits warnings all over
> the place.
Of course, thank you. I'll send a v3 of "Insert SYNOPSIS sections for man pages"
Cheers ... Duncan.
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2021-08-12 18:25 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-08-10 16:08 [PATCH libnetfilter_queue] include: deprecate libnetfilter_queue/linux_nfnetlink_queue.h Pablo Neira Ayuso
2021-08-11 6:21 ` Duncan Roe
2021-08-11 9:02 ` Pablo Neira Ayuso
2021-08-11 19:06 ` Duncan Roe
2021-08-12 8:20 ` Pablo Neira Ayuso
2021-08-12 18:25 ` Duncan Roe
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.