Skip to contentSkip to conversation

configure: exit if libnftnl is not found

PATCH In review Giuseppe Longo 3 participants 6 messages Mar 27, 2016 – Apr 12, 2016 1 message not in the archive netfilter

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 configure: exit if libnftnl is not found

iptables building is broken if libnftnl is not installed on the system, raising up the following errors:

nft-shared.c:25:27: fatal error: libnftnl/rule.h: No such file or directory

 #include <libnftnl/rule.h>
                           ^
compilation terminated.
nft.c:41:28: fatal error: libnftnl/table.h: No such file or directory
 #include <libnftnl/table.h>
                            ^
compilation terminated.
mv -f .deps/xtables_multi-iptables-restore.Tpo .deps/xtables_multi-iptables-restore.Po
In file included from nft.h:5:0,
                 from nft-ipv6.c:25:
nft-shared.h:6:27: fatal error: libnftnl/rule.h: No such file or directory
 #include <libnftnl/rule.h>
                           ^
mv -f .deps/xtables_multi-xshared.Tpo .deps/xtables_multi-xshared.Po
compilation terminated.
In file included from nft.h:5:0,
                 from nft-ipv4.c:26:

nft-shared.h:6:27: fatal error: libnftnl/rule.h: No such file or directory
#include <libnftnl/rule.h>

configure script checks if libnftnl is installed, but doesn't exit if it is not.

---
 configure.ac | 7 +++++++
 1 file changed, 7 insertions(+)
configure.ac +7 -0
index 33a8f2d..b08ecca 100644
@@ -128,6 +128,13 @@ if test "x$enable_nftables" = "xyes"; then
 
 	PKG_CHECK_MODULES([libnftnl], [libnftnl >= 1.0.5], [nftables=1], [nftables=0])
 
+	if test "$nftables" = 0;
+	then
+		echo "*** Error: No suitable libnftnl found. ***"
+		echo "    Please install the 'libnftnl' package."
+		exit 1
+	fi
+
 	AM_PROG_LEX
 	AC_PROG_YACC
 
Signature · 1 line
2.5.0
#1 lore raw

configure.ac if test "x$enable_nftables" = "xyes"; then · line 137

Quoted 12 lines · Giuseppe Longo

+++ b/configure.ac

configure.ac +7 -0
@@ -128,6 +128,13 @@ if test "x$enable_nftables" = "xyes"; then
 
 	PKG_CHECK_MODULES([libnftnl], [libnftnl >= 1.0.5], [nftables=1], [nftables=0])
 
+	if test "$nftables" = 0;
+	then
+		echo "*** Error: No suitable libnftnl found. ***"
+		echo "    Please install the 'libnftnl' package."
+		exit 1
+	fi
+

This is totally unnecessary. Just remove the 3rd and 4th argument from the PKG_CHECK_MODULES call immediately preceding it if libnftnl has become a hard requirement.

A message that is not in the archive (sent off-list or not yet received): CAFpD06TyVSe5_YvsNoJV9LFbHsFGaWhBPu-C=PtVcrVVZbzH4g@mail.gmail.com

#3 lore raw
Quoted 13 lines · Giuseppe Longo
Quoted 4 lines

Review if test "x$enable_nftables" = "xyes"; then · line 129

Quoted 4 lines

+++ b/configure.ac

(quoted diff) +0 -0
@@ -128,6 +128,13 @@ if test "x$enable_nftables" = "xyes"; then
 
        PKG_CHECK_MODULES([libnftnl], [libnftnl >= 1.0.5], [nftables=1],

[nftables=0])

Quoted 8 lines
Quoted 7 lines
configure.ac +6 -0
+      if test "$nftables" = 0;
+      then
+              echo "*** Error: No suitable libnftnl found. ***"
+              echo "    Please install the 'libnftnl' package."
+              exit 1
+      fi
Quoted 4 lines
Quoted 2 lines

This is unnecessary. Just remove the 3rd and 4th argument from the PKG_CHECK_MODULES call.

We may use the 3rd argument instead of remove it.

What good would that do? If you abolish the nftables=0 case,
then everything else becomes 'always-nftables' and
[nftables=1] would be redundant to mention.
--
To unsubscribe from this list: send the line "unsubscribe netfilter-devel" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

#4 lore raw
In reply to Giuseppe Longo
Quoted 37 lines · Giuseppe Longo

iptables building is broken if libnftnl is not installed on the system, raising up the following errors:

nft-shared.c:25:27: fatal error: libnftnl/rule.h: No such file or directory

 #include <libnftnl/rule.h>
                           ^
compilation terminated.
nft.c:41:28: fatal error: libnftnl/table.h: No such file or directory
 #include <libnftnl/table.h>
                            ^
compilation terminated.
mv -f .deps/xtables_multi-iptables-restore.Tpo .deps/xtables_multi-iptables-restore.Po
In file included from nft.h:5:0,
                 from nft-ipv6.c:25:
nft-shared.h:6:27: fatal error: libnftnl/rule.h: No such file or directory
 #include <libnftnl/rule.h>
                           ^
mv -f .deps/xtables_multi-xshared.Tpo .deps/xtables_multi-xshared.Po
compilation terminated.
In file included from nft.h:5:0,
                 from nft-ipv4.c:26:

nft-shared.h:6:27: fatal error: libnftnl/rule.h: No such file or directory
#include <libnftnl/rule.h>

configure script checks if libnftnl is installed, but doesn't exit if it is not.

---
 configure.ac | 7 +++++++
 1 file changed, 7 insertions(+)
configure.ac +0 -0
index 33a8f2d..b08ecca 100644

configure.ac if test "x$enable_nftables" = "xyes"; then · line 134

Quoted 7 lines
configure.ac +4 -0
@@ -128,6 +128,13 @@ if test "x$enable_nftables" = "xyes"; then
 
 	PKG_CHECK_MODULES([libnftnl], [libnftnl >= 1.0.5], [nftables=1], [nftables=0])
 
+	if test "$nftables" = 0;
+	then
+		echo "*** Error: No suitable libnftnl found. ***"
+		echo "    Please install the 'libnftnl' package."

I'm going to take this patch, but mangle it to include this information too:

echo " Or consider --disable-nftables to skip "
echo " iptables-compat over nftables support."

#5 lore raw

Hi Pablo,

2016-04-08 14:55 GMT+02:00 Pablo Neira Ayuso <[email protected]>:

Quoted 48 lines · Giuseppe Longo
Quoted 37 lines

iptables building is broken if libnftnl is not installed on the system, raising up the following errors:

nft-shared.c:25:27: fatal error: libnftnl/rule.h: No such file or directory

 #include <libnftnl/rule.h>
                           ^
compilation terminated.
nft.c:41:28: fatal error: libnftnl/table.h: No such file or directory
 #include <libnftnl/table.h>
                            ^
compilation terminated.
mv -f .deps/xtables_multi-iptables-restore.Tpo .deps/xtables_multi-iptables-restore.Po
In file included from nft.h:5:0,
                 from nft-ipv6.c:25:
nft-shared.h:6:27: fatal error: libnftnl/rule.h: No such file or directory
 #include <libnftnl/rule.h>
                           ^
mv -f .deps/xtables_multi-xshared.Tpo .deps/xtables_multi-xshared.Po
compilation terminated.
In file included from nft.h:5:0,
                 from nft-ipv4.c:26:

nft-shared.h:6:27: fatal error: libnftnl/rule.h: No such file or directory
#include <libnftnl/rule.h>

configure script checks if libnftnl is installed, but doesn't exit if it is not.

---
 configure.ac | 7 +++++++
 1 file changed, 7 insertions(+)
configure.ac +0 -0
index 33a8f2d..b08ecca 100644

configure.ac if test "x$enable_nftables" = "xyes"; then · line 134

Quoted 7 lines
configure.ac +4 -0
@@ -128,6 +128,13 @@ if test "x$enable_nftables" = "xyes"; then
 
      PKG_CHECK_MODULES([libnftnl], [libnftnl >= 1.0.5], [nftables=1], [nftables=0])
 
+     if test "$nftables" = 0;
+     then
+             echo "*** Error: No suitable libnftnl found. ***"
+             echo "    Please install the 'libnftnl' package."

I'm going to take this patch, but mangle it to include this information too:

Quoted 3 lines

echo " Or consider --disable-nftables to skip "
echo " iptables-compat over nftables support."

I can send a v2 of this patch with these changes. I think a similar patch is needed for libmnl because there is a same issue.

#6 lore raw
Quoted 11 lines · Giuseppe Longo
Quoted 11 lines

configure.ac if test "x$enable_nftables" = "xyes"; then · line 134

Quoted 8 lines
configure.ac +4 -0
@@ -128,6 +128,13 @@ if test "x$enable_nftables" = "xyes"; then
 
      PKG_CHECK_MODULES([libnftnl], [libnftnl >= 1.0.5], [nftables=1], [nftables=0])
 
+     if test "$nftables" = 0;
+     then
+             echo "*** Error: No suitable libnftnl found. ***"
+             echo "    Please install the 'libnftnl' package."

I'm going to take this patch, but mangle it to include this information too:

Quoted 7 lines
Quoted 3 lines

echo " Or consider --disable-nftables to skip "
echo " iptables-compat over nftables support."

I can send a v2 of this patch with these changes. I think a similar patch is needed for libmnl because there is a same issue.

Fine with me, I'd appreciate if you send a v2. Thanks!