Skip to contentSkip to conversation

configure: make libmnl and libnftnl hard requirements

PATCH Applied Giuseppe Longo 3 participants 4 messages Apr 26, 2016 – Apr 27, 2016 netfilter

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 configure: make libmnl and libnftnl hard requirements

From: Giuseppe Longo <[email protected]>

Iptables building is broken if either libmnl orlibnftnl is not installed on the system.

Configure script actually checks if libmnl and libnftnl are installed, but doesn't exit if they are not.

---
 configure.ac | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)
configure.ac +18 -0
index 12bffa9..b170add 100644
@@ -122,8 +122,26 @@ AM_CONDITIONAL([HAVE_LIBNFNETLINK], [test "$nfnetlink" = 1])
 if test "x$enable_nftables" = "xyes"; then
 	PKG_CHECK_MODULES([libmnl], [libmnl >= 1.0], [mnl=1], [mnl=0])
 
+	if test "$mnl" = 0;
+	then
+		echo "*** Error: No suitable libmnl found. ***"
+		echo "    Please install the 'libmnl' package"
+		echo "    Or consider --disable-nftables to skip"
+		echo "    iptables-compat over nftables support."
+		exit 1
+	fi
+
 	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"
+		echo "    Or consider --disable-nftables to skip"
+		echo "    iptables-compat over nftables support."
+		exit 1
+	fi
+
 	AM_PROG_LEX
 	AC_PROG_YACC
 
Signature · 1 line
2.5.0
#1 lore raw
Quoted 7 lines · Giuseppe Longo

index 12bffa9..b170add 100644

configure.ac +0 -0
@@ -122,8 +122,26 @@ AM_CONDITIONAL([HAVE_LIBNFNETLINK], [test "$nfnetlink" = 1])

if test "x$enable_nftables" = "xyes"; then

	PKG_CHECK_MODULES([libmnl], [libmnl >= 1.0], [mnl=1], [mnl=0])

configure.ac

Quoted 8 lines
configure.ac +8 -0
+	if test "$mnl" = 0;
+	then
+		echo "*** Error: No suitable libmnl found. ***"
+		echo "    Please install the 'libmnl' package"
+		echo "    Or consider --disable-nftables to skip"
+		echo "    iptables-compat over nftables support."
+		exit 1
+	fi

As told you before, I find this unnecessary large. Consider this instead.

Quoted 1 line

From afcbd592265af0c3a65c21e8f23e1c2f5a348396 Mon Sep 17 00:00:00 2001

From: Jan Engelhardt <[email protected]>
Date: Tue, 26 Apr 2016 23:18:26 +0200
Subject: [PATCH] build: hard-require libmnl, libnftnl for iptables-nft

---
 configure.ac | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)
configure.ac +4 -3
index 12bffa9..e4eafc6 100644
@@ -120,9 +120,10 @@ PKG_CHECK_MODULES([libnfnetlink], [libnfnetlink >= 1.0],
 AM_CONDITIONAL([HAVE_LIBNFNETLINK], [test "$nfnetlink" = 1])
 
 if test "x$enable_nftables" = "xyes"; then
-	PKG_CHECK_MODULES([libmnl], [libmnl >= 1.0], [mnl=1], [mnl=0])
-
-	PKG_CHECK_MODULES([libnftnl], [libnftnl >= 1.0.5], [nftables=1], [nftables=0])
+	PKG_CHECK_MODULES([libmnl], [libmnl >= 1.0])
+	PKG_CHECK_MODULES([libnftnl], [libnftnl >= 1.0.5])
+	mnl=1
+	nftables=1
 
 	AM_PROG_LEX
 	AC_PROG_YACC
Signature · 1 line
2.6.6
#2 lore raw
Quoted 37 lines · Jan Engelhardt
Quoted 7 lines · Giuseppe Longo

index 12bffa9..b170add 100644

configure.ac +0 -0
@@ -122,8 +122,26 @@ AM_CONDITIONAL([HAVE_LIBNFNETLINK], [test "$nfnetlink" = 1])

if test "x$enable_nftables" = "xyes"; then

	PKG_CHECK_MODULES([libmnl], [libmnl >= 1.0], [mnl=1], [mnl=0])

configure.ac

Quoted 8 lines
configure.ac +8 -0
+	if test "$mnl" = 0;
+	then
+		echo "*** Error: No suitable libmnl found. ***"
+		echo "    Please install the 'libmnl' package"
+		echo "    Or consider --disable-nftables to skip"
+		echo "    iptables-compat over nftables support."
+		exit 1
+	fi

As told you before, I find this unnecessary large. Consider this instead.

From afcbd592265af0c3a65c21e8f23e1c2f5a348396 Mon Sep 17 00:00:00 2001
From: Jan Engelhardt <[email protected]>
Date: Tue, 26 Apr 2016 23:18:26 +0200
Subject: [PATCH] build: hard-require libmnl, libnftnl for iptables-nft

---
 configure.ac | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)
configure.ac +0 -0
index 12bffa9..e4eafc6 100644

configure.ac PKG_CHECK_MODULES([libnfnetlink], [libnfnetlink >= 1.0], · line 126

Quoted 10 lines
configure.ac +4 -3
@@ -120,9 +120,10 @@ PKG_CHECK_MODULES([libnfnetlink], [libnfnetlink >= 1.0],
 AM_CONDITIONAL([HAVE_LIBNFNETLINK], [test "$nfnetlink" = 1])
 
 if test "x$enable_nftables" = "xyes"; then
-	PKG_CHECK_MODULES([libmnl], [libmnl >= 1.0], [mnl=1], [mnl=0])
-
-	PKG_CHECK_MODULES([libnftnl], [libnftnl >= 1.0.5], [nftables=1], [nftables=0])
+	PKG_CHECK_MODULES([libmnl], [libmnl >= 1.0])
+	PKG_CHECK_MODULES([libnftnl], [libnftnl >= 1.0.5])
+	mnl=1
+	nftables=1

This doesn't give a clue to users on what they can actually do.

I find Giuseppe's patch more informative.

maintainer Applied
#3 lore raw
In reply to Giuseppe Longo
Quoted 7 lines · Giuseppe Longo

From: Giuseppe Longo <[email protected]>

Iptables building is broken if either libmnl orlibnftnl is not installed on the system.

Configure script actually checks if libmnl and libnftnl are installed, but doesn't exit if they are not.

Applied, thanks Giuseppe.