All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH libnetfilter_queue v2] src: Stop users from accidentally using legacy linux_nfnetlink_queue.h
@ 2021-08-06  2:15 Duncan Roe
  2021-08-06  5:35 ` Duncan Roe
  2021-08-10 16:09 ` Pablo Neira Ayuso
  0 siblings, 2 replies; 3+ messages in thread
From: Duncan Roe @ 2021-08-06  2:15 UTC (permalink / raw)
  To: pablo; +Cc: netfilter-devel

If a user coded
  #include <libnetfilter_queue/libnetfilter_queue.h>
  #include <linux/netfilter/nfnetlink_queue.h>
then instead of nfnetlink_queue.h they would get linux_nfnetlink_queue.h.
In the library, this only affects libnetfilter_queue.c

Signed-off-by: Duncan Roe <duncan_roe@optusnet.com.au>
---
 include/libnetfilter_queue/libnetfilter_queue.h | 2 --
 src/libnetfilter_queue.c                        | 1 +
 utils/nfqnl_test.c                              | 1 +
 3 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/include/libnetfilter_queue/libnetfilter_queue.h b/include/libnetfilter_queue/libnetfilter_queue.h
index a19122f..42a3a45 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/src/libnetfilter_queue.c b/src/libnetfilter_queue.c
index ef3b211..899c765 100644
--- a/src/libnetfilter_queue.c
+++ b/src/libnetfilter_queue.c
@@ -32,6 +32,7 @@
 
 #include <libnfnetlink/libnfnetlink.h>
 #include <libnetfilter_queue/libnetfilter_queue.h>
+#include <libnetfilter_queue/linux_nfnetlink_queue.h>
 #include "internal.h"
 
 /**
diff --git a/utils/nfqnl_test.c b/utils/nfqnl_test.c
index 5e76ffe..682f3d7 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.17.5


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH libnetfilter_queue v2] src: Stop users from accidentally using legacy linux_nfnetlink_queue.h
  2021-08-06  2:15 [PATCH libnetfilter_queue v2] src: Stop users from accidentally using legacy linux_nfnetlink_queue.h Duncan Roe
@ 2021-08-06  5:35 ` Duncan Roe
  2021-08-10 16:09 ` Pablo Neira Ayuso
  1 sibling, 0 replies; 3+ messages in thread
From: Duncan Roe @ 2021-08-06  5:35 UTC (permalink / raw)
  To: Pablo Neira Ayuso; +Cc: Netfilter Development

On Fri, Aug 06, 2021 at 12:15:13PM +1000, Duncan Roe wrote:
> If a user coded
>   #include <libnetfilter_queue/libnetfilter_queue.h>
>   #include <linux/netfilter/nfnetlink_queue.h>
> then instead of nfnetlink_queue.h they would get linux_nfnetlink_queue.h.
> In the library, this only affects libnetfilter_queue.c
>
> Signed-off-by: Duncan Roe <duncan_roe@optusnet.com.au>
> ---
[...]
Sorry, the v2 comment at this point should have been:

> v2: also update utils/nfqnl_test.c (required for good make distcheck)

Cheers ... Duncan.

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH libnetfilter_queue v2] src: Stop users from accidentally using legacy linux_nfnetlink_queue.h
  2021-08-06  2:15 [PATCH libnetfilter_queue v2] src: Stop users from accidentally using legacy linux_nfnetlink_queue.h Duncan Roe
  2021-08-06  5:35 ` Duncan Roe
@ 2021-08-10 16:09 ` Pablo Neira Ayuso
  1 sibling, 0 replies; 3+ messages in thread
From: Pablo Neira Ayuso @ 2021-08-10 16:09 UTC (permalink / raw)
  To: Duncan Roe; +Cc: netfilter-devel

On Fri, Aug 06, 2021 at 12:15:13PM +1000, Duncan Roe wrote:
> If a user coded
>   #include <libnetfilter_queue/libnetfilter_queue.h>
>   #include <linux/netfilter/nfnetlink_queue.h>
> then instead of nfnetlink_queue.h they would get linux_nfnetlink_queue.h.
> In the library, this only affects libnetfilter_queue.c

Emit a warning to deprecate linux_nfnetlink_queue.h (which is a copy
of the original nfnetlink_queue.h), users instead should be using
<linux/netfilter/nfnetlink_queue.h>.

To ensure that a project compiles standalone (without the need for the
system kernel header files), you can cache a copy of the header in
your software tree (we use this trick for a while in userspace
netfilter software).

https://patchwork.ozlabs.org/project/netfilter-devel/patch/20210810160813.26984-1-pablo@netfilter.org/

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2021-08-10 16:09 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-08-06  2:15 [PATCH libnetfilter_queue v2] src: Stop users from accidentally using legacy linux_nfnetlink_queue.h Duncan Roe
2021-08-06  5:35 ` Duncan Roe
2021-08-10 16:09 ` Pablo Neira Ayuso

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.