netfilter-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [iptables][PATCH] configure: Add option to enable/disable libnfnetlink
@ 2024-04-24 12:29 Alexander Kanavin
  0 siblings, 0 replies; 9+ messages in thread
From: Alexander Kanavin @ 2024-04-24 12:29 UTC (permalink / raw)
  To: phil, netfilter-devel

From: "Maxin B. John" <maxin.john@intel.com>

This changes the configure behaviour from autodetecting
for libnfnetlink to having an option to disable it explicitly.

Signed-off-by: Khem Raj <raj.khem@gmail.com>
Signed-off-by: Maxin B. John <maxin.john@intel.com>
Signed-off-by: Alexander Kanavin <alex@linutronix.de>
---
 configure.ac | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/configure.ac b/configure.ac
index d99fa3b9..d6077723 100644
--- a/configure.ac
+++ b/configure.ac
@@ -63,6 +63,9 @@ AC_ARG_WITH([pkgconfigdir], AS_HELP_STRING([--with-pkgconfigdir=PATH],
 AC_ARG_ENABLE([nftables],
 	AS_HELP_STRING([--disable-nftables], [Do not build nftables compat]),
 	[enable_nftables="$enableval"], [enable_nftables="yes"])
+AC_ARG_ENABLE([libnfnetlink],
+    AS_HELP_STRING([--disable-libnfnetlink], [Do not use netfilter netlink library]),
+    [enable_libnfnetlink="$enableval"], [enable_libnfnetlink="yes"])
 AC_ARG_ENABLE([connlabel],
 	AS_HELP_STRING([--disable-connlabel],
 	[Do not build libnetfilter_conntrack]),
@@ -113,9 +116,10 @@ AM_CONDITIONAL([ENABLE_SYNCONF], [test "$enable_nfsynproxy" = "yes"])
 AM_CONDITIONAL([ENABLE_NFTABLES], [test "$enable_nftables" = "yes"])
 AM_CONDITIONAL([ENABLE_CONNLABEL], [test "$enable_connlabel" = "yes"])
 
-PKG_CHECK_MODULES([libnfnetlink], [libnfnetlink >= 1.0],
-	[nfnetlink=1], [nfnetlink=0])
-AM_CONDITIONAL([HAVE_LIBNFNETLINK], [test "$nfnetlink" = 1])
+AS_IF([test "x$enable_libnfnetlink" = "xyes"], [
+    PKG_CHECK_MODULES([libnfnetlink], [libnfnetlink >= 1.0])
+    ])
+AM_CONDITIONAL([HAVE_LIBNFNETLINK], [test "x$enable_libnfnetlink" = "xyes"])
 
 if test "x$enable_bpfc" = "xyes" || test "x$enable_nfsynproxy" = "xyes"; then
 	PKG_CHECK_MODULES([libpcap], [libpcap], [], [
-- 
2.39.2


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

* Re: [iptables][PATCH] configure: Add option to enable/disable libnfnetlink
  2024-04-24 14:58     ` Phil Sutter
  2024-04-24 15:20       ` Pablo Neira Ayuso
@ 2024-04-25  8:59       ` Alexander Kanavin
  1 sibling, 0 replies; 9+ messages in thread
From: Alexander Kanavin @ 2024-04-25  8:59 UTC (permalink / raw)
  To: Phil Sutter, netfilter-devel, Khem Raj

On 4/24/24 16:58, Phil Sutter wrote:
> Thanks for the explanation. I don't quite get how a build is
> deterministic if libnfnetlink presence is not, but OK.

If you specify either command line option, the outcome of the build (if 
it is successful) depends only on that option:

- if the option disables support, it will be disabled regardless of 
whether the needed library is present

- if the option enables support, either it will be enabled, or the build 
will error out with a missing library message, avoiding the situation 
where support was requested, but quietly disabled because library wasn't 
found.

>
> The problem I see with the patch is the changed default behaviour. Could
> you please retain the conditional build if neither --enable-libnfnetlink
> nor --disable-libnfnetlink was specified?

I sent a v2 that retains autodetection, can you please check that?


-- 

Alexander Kanavin
Linutronix GmbH | Bahnhofstrasse 3 | D-88690 Uhldingen-Mühlhofen
Phone: +49 7556 25 999 39; Fax.: +49 7556 25 999 99

Hinweise zum Datenschutz finden Sie hier (Informations on data privacy
can be found here): https://linutronix.de/legal/data-protection.php

Linutronix GmbH | Firmensitz (Registered Office): Uhldingen-Mühlhofen |
Registergericht (Registration Court): Amtsgericht Freiburg i.Br., HRB700
806 | Geschäftsführer (Managing Directors): Heinz Egger, Thomas Gleixner
Tiffany Silva, Sean Fennelly, Jeffrey Schneiderman


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

* Re: [iptables][PATCH] configure: Add option to enable/disable libnfnetlink
  2024-04-24 18:35         ` Phil Sutter
@ 2024-04-24 20:14           ` Pablo Neira Ayuso
  0 siblings, 0 replies; 9+ messages in thread
From: Pablo Neira Ayuso @ 2024-04-24 20:14 UTC (permalink / raw)
  To: Phil Sutter, Alexander Kanavin, netfilter-devel, Khem Raj

On Wed, Apr 24, 2024 at 08:35:12PM +0200, Phil Sutter wrote:
> On Wed, Apr 24, 2024 at 05:20:15PM +0200, Pablo Neira Ayuso wrote:
> > On Wed, Apr 24, 2024 at 04:58:40PM +0200, Phil Sutter wrote:
> > > On Wed, Apr 24, 2024 at 04:11:59PM +0200, Alexander Kanavin wrote:
> > > > On 4/24/24 14:53, Phil Sutter wrote:
> > > > > Hi,
> > > > >
> > > > > On Wed, Apr 24, 2024 at 02:28:04PM +0200, Alexander Kanavin wrote:
> > > > >> From: "Maxin B. John" <maxin.john@intel.com>
> > > > >>
> > > > >> This changes the configure behaviour from autodetecting
> > > > >> for libnfnetlink to having an option to disable it explicitly.
> > > > >>
> > > > >> Signed-off-by: Khem Raj <raj.khem@gmail.com>
> > > > >> Signed-off-by: Maxin B. John <maxin.john@intel.com>
> > > > >> Signed-off-by: Alexander Kanavin <alex@linutronix.de>
> > > > > The patch looks fine as-is, I wonder though what's the goal: Does the
> > > > > build system have an incompatible libnfnetlink which breaks the build?
> > > > > It is used by nfnl_osf only, right? So maybe introduce
> > > > > | AC_ARG_ENABLE([nfnl_osf], ...)
> > > > > instead?
> > > > 
> > > > The patch is very old, and I didn't write it (I'm only cleaning up the 
> > > > custom patches that yocto project is currently carrying). It was 
> > > > introduced for the purposes of ensuring build determinism and 
> > > > reproducibility: so that libnfnetlink support doesn't get quietly 
> > > > enabled or disabled depending on what is available in the build system, 
> > > > but can be reliably turned off or on.
> > > 
> > > Thanks for the explanation. I don't quite get how a build is
> > > deterministic if libnfnetlink presence is not, but OK.
> > 
> > IIRC, there are also dependencies on utils with libnfnetlink that
> > would need to be disabled too.
> 
> Within iptables, we only have nfnl_osf (in utils/) which depends on it,
> but missing HAVE_LIBNFNETLINK effectively disables it from being built.
> So unless you have something else in mind, that's fine with and without
> this patch.

That's fine then, thanks.

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

* Re: [iptables][PATCH] configure: Add option to enable/disable libnfnetlink
  2024-04-24 15:20       ` Pablo Neira Ayuso
@ 2024-04-24 18:35         ` Phil Sutter
  2024-04-24 20:14           ` Pablo Neira Ayuso
  0 siblings, 1 reply; 9+ messages in thread
From: Phil Sutter @ 2024-04-24 18:35 UTC (permalink / raw)
  To: Pablo Neira Ayuso; +Cc: Alexander Kanavin, netfilter-devel, Khem Raj

On Wed, Apr 24, 2024 at 05:20:15PM +0200, Pablo Neira Ayuso wrote:
> On Wed, Apr 24, 2024 at 04:58:40PM +0200, Phil Sutter wrote:
> > On Wed, Apr 24, 2024 at 04:11:59PM +0200, Alexander Kanavin wrote:
> > > On 4/24/24 14:53, Phil Sutter wrote:
> > > > Hi,
> > > >
> > > > On Wed, Apr 24, 2024 at 02:28:04PM +0200, Alexander Kanavin wrote:
> > > >> From: "Maxin B. John" <maxin.john@intel.com>
> > > >>
> > > >> This changes the configure behaviour from autodetecting
> > > >> for libnfnetlink to having an option to disable it explicitly.
> > > >>
> > > >> Signed-off-by: Khem Raj <raj.khem@gmail.com>
> > > >> Signed-off-by: Maxin B. John <maxin.john@intel.com>
> > > >> Signed-off-by: Alexander Kanavin <alex@linutronix.de>
> > > > The patch looks fine as-is, I wonder though what's the goal: Does the
> > > > build system have an incompatible libnfnetlink which breaks the build?
> > > > It is used by nfnl_osf only, right? So maybe introduce
> > > > | AC_ARG_ENABLE([nfnl_osf], ...)
> > > > instead?
> > > 
> > > The patch is very old, and I didn't write it (I'm only cleaning up the 
> > > custom patches that yocto project is currently carrying). It was 
> > > introduced for the purposes of ensuring build determinism and 
> > > reproducibility: so that libnfnetlink support doesn't get quietly 
> > > enabled or disabled depending on what is available in the build system, 
> > > but can be reliably turned off or on.
> > 
> > Thanks for the explanation. I don't quite get how a build is
> > deterministic if libnfnetlink presence is not, but OK.
> 
> IIRC, there are also dependencies on utils with libnfnetlink that
> would need to be disabled too.

Within iptables, we only have nfnl_osf (in utils/) which depends on it,
but missing HAVE_LIBNFNETLINK effectively disables it from being built.
So unless you have something else in mind, that's fine with and without
this patch.

Cheers, Phil

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

* Re: [iptables][PATCH] configure: Add option to enable/disable libnfnetlink
  2024-04-24 14:58     ` Phil Sutter
@ 2024-04-24 15:20       ` Pablo Neira Ayuso
  2024-04-24 18:35         ` Phil Sutter
  2024-04-25  8:59       ` Alexander Kanavin
  1 sibling, 1 reply; 9+ messages in thread
From: Pablo Neira Ayuso @ 2024-04-24 15:20 UTC (permalink / raw)
  To: Phil Sutter, Alexander Kanavin, netfilter-devel, Khem Raj

On Wed, Apr 24, 2024 at 04:58:40PM +0200, Phil Sutter wrote:
> On Wed, Apr 24, 2024 at 04:11:59PM +0200, Alexander Kanavin wrote:
> > On 4/24/24 14:53, Phil Sutter wrote:
> > > Hi,
> > >
> > > On Wed, Apr 24, 2024 at 02:28:04PM +0200, Alexander Kanavin wrote:
> > >> From: "Maxin B. John" <maxin.john@intel.com>
> > >>
> > >> This changes the configure behaviour from autodetecting
> > >> for libnfnetlink to having an option to disable it explicitly.
> > >>
> > >> Signed-off-by: Khem Raj <raj.khem@gmail.com>
> > >> Signed-off-by: Maxin B. John <maxin.john@intel.com>
> > >> Signed-off-by: Alexander Kanavin <alex@linutronix.de>
> > > The patch looks fine as-is, I wonder though what's the goal: Does the
> > > build system have an incompatible libnfnetlink which breaks the build?
> > > It is used by nfnl_osf only, right? So maybe introduce
> > > | AC_ARG_ENABLE([nfnl_osf], ...)
> > > instead?
> > 
> > The patch is very old, and I didn't write it (I'm only cleaning up the 
> > custom patches that yocto project is currently carrying). It was 
> > introduced for the purposes of ensuring build determinism and 
> > reproducibility: so that libnfnetlink support doesn't get quietly 
> > enabled or disabled depending on what is available in the build system, 
> > but can be reliably turned off or on.
> 
> Thanks for the explanation. I don't quite get how a build is
> deterministic if libnfnetlink presence is not, but OK.

IIRC, there are also dependencies on utils with libnfnetlink that
would need to be disabled too.


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

* Re: [iptables][PATCH] configure: Add option to enable/disable libnfnetlink
  2024-04-24 14:11   ` Alexander Kanavin
@ 2024-04-24 14:58     ` Phil Sutter
  2024-04-24 15:20       ` Pablo Neira Ayuso
  2024-04-25  8:59       ` Alexander Kanavin
  0 siblings, 2 replies; 9+ messages in thread
From: Phil Sutter @ 2024-04-24 14:58 UTC (permalink / raw)
  To: Alexander Kanavin; +Cc: netfilter-devel, Khem Raj

On Wed, Apr 24, 2024 at 04:11:59PM +0200, Alexander Kanavin wrote:
> On 4/24/24 14:53, Phil Sutter wrote:
> > Hi,
> >
> > On Wed, Apr 24, 2024 at 02:28:04PM +0200, Alexander Kanavin wrote:
> >> From: "Maxin B. John" <maxin.john@intel.com>
> >>
> >> This changes the configure behaviour from autodetecting
> >> for libnfnetlink to having an option to disable it explicitly.
> >>
> >> Signed-off-by: Khem Raj <raj.khem@gmail.com>
> >> Signed-off-by: Maxin B. John <maxin.john@intel.com>
> >> Signed-off-by: Alexander Kanavin <alex@linutronix.de>
> > The patch looks fine as-is, I wonder though what's the goal: Does the
> > build system have an incompatible libnfnetlink which breaks the build?
> > It is used by nfnl_osf only, right? So maybe introduce
> > | AC_ARG_ENABLE([nfnl_osf], ...)
> > instead?
> 
> The patch is very old, and I didn't write it (I'm only cleaning up the 
> custom patches that yocto project is currently carrying). It was 
> introduced for the purposes of ensuring build determinism and 
> reproducibility: so that libnfnetlink support doesn't get quietly 
> enabled or disabled depending on what is available in the build system, 
> but can be reliably turned off or on.

Thanks for the explanation. I don't quite get how a build is
deterministic if libnfnetlink presence is not, but OK.

The problem I see with the patch is the changed default behaviour. Could
you please retain the conditional build if neither --enable-libnfnetlink
nor --disable-libnfnetlink was specified?

> Note that we also carry a related patch which I didn't look at properly 
> yet, but can submit as well:
> 
> https://git.yoctoproject.org/poky/tree/meta/recipes-extended/iptables/iptables/0004-configure.ac-only-check-conntrack-when-libnfnetlink-.patch

Implementing the above might require adjustments in this one, so you
might want to hold back a bit.

Cheers, Phil

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

* Re: [iptables][PATCH] configure: Add option to enable/disable libnfnetlink
  2024-04-24 12:53 ` Phil Sutter
@ 2024-04-24 14:11   ` Alexander Kanavin
  2024-04-24 14:58     ` Phil Sutter
  0 siblings, 1 reply; 9+ messages in thread
From: Alexander Kanavin @ 2024-04-24 14:11 UTC (permalink / raw)
  To: Phil Sutter, netfilter-devel, Khem Raj

On 4/24/24 14:53, Phil Sutter wrote:
> Hi,
>
> On Wed, Apr 24, 2024 at 02:28:04PM +0200, Alexander Kanavin wrote:
>> From: "Maxin B. John" <maxin.john@intel.com>
>>
>> This changes the configure behaviour from autodetecting
>> for libnfnetlink to having an option to disable it explicitly.
>>
>> Signed-off-by: Khem Raj <raj.khem@gmail.com>
>> Signed-off-by: Maxin B. John <maxin.john@intel.com>
>> Signed-off-by: Alexander Kanavin <alex@linutronix.de>
> The patch looks fine as-is, I wonder though what's the goal: Does the
> build system have an incompatible libnfnetlink which breaks the build?
> It is used by nfnl_osf only, right? So maybe introduce
> | AC_ARG_ENABLE([nfnl_osf], ...)
> instead?

The patch is very old, and I didn't write it (I'm only cleaning up the 
custom patches that yocto project is currently carrying). It was 
introduced for the purposes of ensuring build determinism and 
reproducibility: so that libnfnetlink support doesn't get quietly 
enabled or disabled depending on what is available in the build system, 
but can be reliably turned off or on.

Note that we also carry a related patch which I didn't look at properly 
yet, but can submit as well:

https://git.yoctoproject.org/poky/tree/meta/recipes-extended/iptables/iptables/0004-configure.ac-only-check-conntrack-when-libnfnetlink-.patch

-- 

Alexander Kanavin
Linutronix GmbH | Bahnhofstrasse 3 | D-88690 Uhldingen-Mühlhofen
Phone: +49 7556 25 999 39; Fax.: +49 7556 25 999 99

Hinweise zum Datenschutz finden Sie hier (Informations on data privacy
can be found here): https://linutronix.de/legal/data-protection.php

Linutronix GmbH | Firmensitz (Registered Office): Uhldingen-Mühlhofen |
Registergericht (Registration Court): Amtsgericht Freiburg i.Br., HRB700
806 | Geschäftsführer (Managing Directors): Heinz Egger, Thomas Gleixner
Tiffany Silva, Sean Fennelly, Jeffrey Schneiderman


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

* Re: [iptables][PATCH] configure: Add option to enable/disable libnfnetlink
  2024-04-24 12:28 Alexander Kanavin
@ 2024-04-24 12:53 ` Phil Sutter
  2024-04-24 14:11   ` Alexander Kanavin
  0 siblings, 1 reply; 9+ messages in thread
From: Phil Sutter @ 2024-04-24 12:53 UTC (permalink / raw)
  To: Alexander Kanavin; +Cc: netfilter-devel, Maxin B. John, Khem Raj

Hi,

On Wed, Apr 24, 2024 at 02:28:04PM +0200, Alexander Kanavin wrote:
> From: "Maxin B. John" <maxin.john@intel.com>
> 
> This changes the configure behaviour from autodetecting
> for libnfnetlink to having an option to disable it explicitly.
> 
> Signed-off-by: Khem Raj <raj.khem@gmail.com>
> Signed-off-by: Maxin B. John <maxin.john@intel.com>
> Signed-off-by: Alexander Kanavin <alex@linutronix.de>

The patch looks fine as-is, I wonder though what's the goal: Does the
build system have an incompatible libnfnetlink which breaks the build?
It is used by nfnl_osf only, right? So maybe introduce
| AC_ARG_ENABLE([nfnl_osf], ...)
instead?

Thanks, Phil

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

* [iptables][PATCH] configure: Add option to enable/disable libnfnetlink
@ 2024-04-24 12:28 Alexander Kanavin
  2024-04-24 12:53 ` Phil Sutter
  0 siblings, 1 reply; 9+ messages in thread
From: Alexander Kanavin @ 2024-04-24 12:28 UTC (permalink / raw)
  To: phil, netfilter-devel; +Cc: Maxin B. John, Khem Raj, Alexander Kanavin

From: "Maxin B. John" <maxin.john@intel.com>

This changes the configure behaviour from autodetecting
for libnfnetlink to having an option to disable it explicitly.

Signed-off-by: Khem Raj <raj.khem@gmail.com>
Signed-off-by: Maxin B. John <maxin.john@intel.com>
Signed-off-by: Alexander Kanavin <alex@linutronix.de>
---
 configure.ac | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/configure.ac b/configure.ac
index d99fa3b9..d6077723 100644
--- a/configure.ac
+++ b/configure.ac
@@ -63,6 +63,9 @@ AC_ARG_WITH([pkgconfigdir], AS_HELP_STRING([--with-pkgconfigdir=PATH],
 AC_ARG_ENABLE([nftables],
 	AS_HELP_STRING([--disable-nftables], [Do not build nftables compat]),
 	[enable_nftables="$enableval"], [enable_nftables="yes"])
+AC_ARG_ENABLE([libnfnetlink],
+    AS_HELP_STRING([--disable-libnfnetlink], [Do not use netfilter netlink library]),
+    [enable_libnfnetlink="$enableval"], [enable_libnfnetlink="yes"])
 AC_ARG_ENABLE([connlabel],
 	AS_HELP_STRING([--disable-connlabel],
 	[Do not build libnetfilter_conntrack]),
@@ -113,9 +116,10 @@ AM_CONDITIONAL([ENABLE_SYNCONF], [test "$enable_nfsynproxy" = "yes"])
 AM_CONDITIONAL([ENABLE_NFTABLES], [test "$enable_nftables" = "yes"])
 AM_CONDITIONAL([ENABLE_CONNLABEL], [test "$enable_connlabel" = "yes"])
 
-PKG_CHECK_MODULES([libnfnetlink], [libnfnetlink >= 1.0],
-	[nfnetlink=1], [nfnetlink=0])
-AM_CONDITIONAL([HAVE_LIBNFNETLINK], [test "$nfnetlink" = 1])
+AS_IF([test "x$enable_libnfnetlink" = "xyes"], [
+    PKG_CHECK_MODULES([libnfnetlink], [libnfnetlink >= 1.0])
+    ])
+AM_CONDITIONAL([HAVE_LIBNFNETLINK], [test "x$enable_libnfnetlink" = "xyes"])
 
 if test "x$enable_bpfc" = "xyes" || test "x$enable_nfsynproxy" = "xyes"; then
 	PKG_CHECK_MODULES([libpcap], [libpcap], [], [
-- 
2.39.2


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

end of thread, other threads:[~2024-04-25  8:59 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-04-24 12:29 [iptables][PATCH] configure: Add option to enable/disable libnfnetlink Alexander Kanavin
  -- strict thread matches above, loose matches on Subject: below --
2024-04-24 12:28 Alexander Kanavin
2024-04-24 12:53 ` Phil Sutter
2024-04-24 14:11   ` Alexander Kanavin
2024-04-24 14:58     ` Phil Sutter
2024-04-24 15:20       ` Pablo Neira Ayuso
2024-04-24 18:35         ` Phil Sutter
2024-04-24 20:14           ` Pablo Neira Ayuso
2024-04-25  8:59       ` Alexander Kanavin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).