]> git.ipfire.org Git - thirdparty/nftables.git/commitdiff
xt: fix build with --with-xtables
authorFlorian Westphal <fw@strlen.de>
Sat, 29 Dec 2018 20:29:00 +0000 (21:29 +0100)
committerFlorian Westphal <fw@strlen.de>
Sat, 29 Dec 2018 20:29:22 +0000 (21:29 +0100)
The previous change is bonkers, it fixes build when libxtables isn't
even installed, but broke build when --with-xtables is provided to configure.

Reason is that the include guard comes too early, so xtables.h is never
included, causing build to fail because no libxtables function prototypes
and definitions are available.

Fixes: 9e84f3f083bb ("xt: fix build when libxtables is not installed")
Signed-off-by: Florian Westphal <fw@strlen.de>
src/xt.c

index 08560976aa0f2eea882a96abc7681fc94479ff41..c80e1fc0b2b0d8e7288e3c7e19b5b2951d5a13a6 100644 (file)
--- a/src/xt.c
+++ b/src/xt.c
@@ -11,9 +11,6 @@
 #include <time.h>
 #include <string.h>
 #include <net/if.h>
-#ifdef HAVE_LIBXTABLES
-#include <xtables.h>
-#endif
 #include <getopt.h>
 #include <ctype.h>     /* for isspace */
 #include <statement.h>
 #include <linux/netfilter_arp/arp_tables.h>
 #include <linux/netfilter_bridge/ebtables.h>
 
+#ifdef HAVE_LIBXTABLES
+#include <xtables.h>
+#endif
+
 void xt_stmt_xlate(const struct stmt *stmt, struct output_ctx *octx)
 {
 #ifdef HAVE_LIBXTABLES