src: Stop users from accidentally using legacy linux_nfnetlink_queue.h
PATCH v2 1/1 src: Stop users from accidentally using legacy linux_nfnetlink_queue.h
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
--- include/libnetfilter_queue/libnetfilter_queue.h | 2 -- src/libnetfilter_queue.c | 1 + utils/nfqnl_test.c | 1 + 3 files changed, 2 insertions(+), 2 deletions(-)
include/libnetfilter_queue/libnetfilter_queue.h +0 -2
@@ -16,8 +16,6 @@#include <sys/time.h> #include <libnfnetlink/libnfnetlink.h> -#include <libnetfilter_queue/linux_nfnetlink_queue.h> -#ifdef __cplusplusextern "C" {#endif
src/libnetfilter_queue.c +1 -0
@@ -32,6 +32,7 @@#include <libnfnetlink/libnfnetlink.h> #include <libnetfilter_queue/libnetfilter_queue.h> +#include <libnetfilter_queue/linux_nfnetlink_queue.h> #include "internal.h" /**
utils/nfqnl_test.c +1 -0
@@ -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>
Signature · 1 line
2.17.5
Quoted 8 lines · Duncan Roe
If a user coded
#include <libnetfilter_queue/libnetfilter_queue.h>
#include <linux/netfilter/nfnetlink_queue.h>
then instead ofnfnetlink_queue.hthey would getlinux_nfnetlink_queue.h. In the library, this only affectslibnetfilter_queue.cSigned-off-by Duncan Roe <[email protected]>---
[...]
Sorry, the v2 comment at this point should have been:
Quoted 1 line
v2: also update
utils/nfqnl_test.c(required for good make distcheck)
Cheers ... Duncan.
Pablo Neira Ayuso
maintainerQuoted 5 lines · Duncan Roe
If a user coded
#include <libnetfilter_queue/libnetfilter_queue.h>
#include <linux/netfilter/nfnetlink_queue.h>
then instead ofnfnetlink_queue.hthey would getlinux_nfnetlink_queue.h. In the library, this only affectslibnetfilter_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/[email protected]/