All of lore.kernel.org
 help / color / mirror / Atom feed
From: Phil Sutter <phil@nwl.cc>
To: Pablo Neira Ayuso <pablo@netfilter.org>
Cc: Thomas Devoogdt <thomas@devoogdt.com>,
	netfilter-devel@vger.kernel.org,
	Thomas Devoogdt <thomas.devoogdt@barco.com>
Subject: Re: [PATCH] [iptables] extensions: libxt_LOG.c: fix linux/netfilter/xt_LOG.h include on Linux < 3.4
Date: Wed, 22 Feb 2023 16:32:09 +0100	[thread overview]
Message-ID: <Y/Y1efOjGyBo0MAj@orbyte.nwl.cc> (raw)
In-Reply-To: <Y/YZC1Feu9gOCdWF@salvia>

On Wed, Feb 22, 2023 at 02:30:51PM +0100, Pablo Neira Ayuso wrote:
> On Wed, Feb 22, 2023 at 01:07:15PM +0100, Phil Sutter wrote:
> > On Wed, Feb 22, 2023 at 11:04:41AM +0100, Pablo Neira Ayuso wrote:
> > > On Wed, Feb 22, 2023 at 08:23:49AM +0100, Thomas Devoogdt wrote:
> > > > libxt_LOG.c:6:10: fatal error: linux/netfilter/xt_LOG.h: No such file or directory
> > > > . #include <linux/netfilter/xt_LOG.h>
> > > >           ^~~~~~~~~~~~~~~~~~~~~~~~~~
> > > > 
> > > > Linux < 3.4 defines are in include/linux/netfilter_ipv{4,6}/ipt_LOG.h,
> > > > but the naming is slightly different, so just define it here as the values are the same.
> > > > 
> > > > https://github.com/torvalds/linux/commit/6939c33a757bd006c5e0b8b5fd429fc587a4d0f4
> > > 
> > > Probably you could add xt_LOG.h to iptables/include/linux/netfilter/ ?
> > > 
> > > There are plenty of headers that are cached there to make sure
> > > userspace compile with minimal external dependencies.
> > > 
> > > xt_LOG.h is missing for some reason in that folder, but there are many
> > > of xt_*.h files there.
> > 
> > While being at it, how about caching all netfilter kernel headers we
> > include? The only downside I see is that we may have to update them from
> > time to time (in case new symbols land) but that's rare and the
> > alternative is accidental breakages like above.
> 
> Caching _all_ dependencies is going to be hard, because it might pull
> in lots of header files. The idea so far has been to find a reasonable
> tradeoff, ensuring that iptables compilation is self-contained in a
> best effort approach.

OK, for fun I tried compiling with linux headers from 2.6.39 and 3.0.101
in /usr/include/linux. The only missing files apart from the above were
linux/bpf{,_common}.h. So I guess if we add those as well, we're good
for a while. :)

> > WDYT? I'd volunteer to do it. :)
> 
> iptables already caches a lot of header files, as I said I don't
> remember why this one has never been cached before.

Git says, it's my fault. :(
When merging libipt and libip6t LOG.c files, I introduced the include
but missed to copy the header as well.

I'll apply Thomas' patch adding a reference to my commit and follow up
with bpf header copy (unless someone objects).

Thanks, Phil

  reply	other threads:[~2023-02-22 15:32 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-02-22  7:23 [PATCH] [iptables] extensions: libxt_LOG.c: fix linux/netfilter/xt_LOG.h include on Linux < 3.4 Thomas Devoogdt
2023-02-22 10:04 ` Pablo Neira Ayuso
2023-02-22 12:07   ` Phil Sutter
2023-02-22 13:30     ` Pablo Neira Ayuso
2023-02-22 15:32       ` Phil Sutter [this message]
2023-02-22 15:34         ` Phil Sutter
2023-02-22 15:55         ` Phil Sutter
2023-02-22 16:21           ` Thomas Devoogdt
2023-02-22 16:38             ` Phil Sutter

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=Y/Y1efOjGyBo0MAj@orbyte.nwl.cc \
    --to=phil@nwl.cc \
    --cc=netfilter-devel@vger.kernel.org \
    --cc=pablo@netfilter.org \
    --cc=thomas.devoogdt@barco.com \
    --cc=thomas@devoogdt.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.