All of lore.kernel.org
 help / color / mirror / Atom feed
From: Pablo Neira Ayuso <pablo@netfilter.org>
To: Alessandro Vesely <vesely@tana.it>
Cc: netfilter@vger.kernel.org
Subject: Re: Extending an IPv4 filter to IPv6
Date: Sun, 20 Aug 2023 23:41:43 +0200	[thread overview]
Message-ID: <ZOKIl6qWCdLCTPPT@calendula> (raw)
In-Reply-To: <9d98b203-b22a-898c-1a4f-c83e706bc411@tana.it>

On Fri, Aug 18, 2023 at 12:56:38PM +0200, Alessandro Vesely wrote:
> Hi all,
> 
> I have an old program (ipqbdb) which filters IPv4 packets using
> libnetfilter_queue.  I want to extend it to also filter IPv6, now that at
> last I can use some of those addresses.
> 
> The program obtains a handle by nfq_open(), and then (after unbind) binds by
> nfq_bind_pf(h, AF_INET).  Afterwards it creates the configured number of
> queues and filters the packets it finds there.
> 
> There is a big DEPRECATED in the documentation, and the generated doc for
> nfq_bind_pf() parameters says "This call is obsolete, Linux kernels from 3.8
> onwards ignore it" (which is obviously false).
> https://netfilter.org/projects/libnetfilter_queue/doxygen/
> 
> So, the first question: Can I keep using these functions?  What is the alternative?

The alternative is the libmnl-based API which is the way to go for new
applications.

> Second question: Is there a "mixed mode" parameter, besides PF_INET and
> PF_INET6, that allows to capture both types?  In that case, can a queue
> receive either packet?

Using the 'inet' family in nftables, it should be possible to send
both IPv4 and IPv6 packets to one single queue in userspace.

  parent reply	other threads:[~2023-08-20 21:41 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-08-18 10:56 Extending an IPv4 filter to IPv6, Extending an IPv4 filter to IPv6 Alessandro Vesely
2023-08-19  1:46 ` Duncan Roe
2023-08-19  9:53   ` Extending an IPv4 filter to IPv6, " Alessandro Vesely
2023-08-20  1:09     ` Duncan Roe
2023-08-20 21:39   ` Pablo Neira Ayuso
2023-08-20 21:41 ` Pablo Neira Ayuso [this message]
2023-08-21 17:18   ` Extending an IPv4 filter to IPv6, " Alessandro Vesely
2023-08-21 19:10     ` Pablo Neira Ayuso
2023-08-22 18:09       ` Extending an IPv4 filter to IPv6, " Alessandro Vesely
2023-08-27  8:34         ` Duncan Roe
2023-08-27 17:20           ` Extending an IPv4 filter to IPv6, " Alessandro Vesely
2023-08-27 18:58             ` Duncan Roe
2023-08-27 21:12               ` Pablo Neira Ayuso
2023-08-27 20:49           ` Pablo Neira Ayuso
2023-08-27 20:48         ` Pablo Neira Ayuso
2023-08-31  9:22           ` Extending an IPv4 filter to IPv6, " Alessandro Vesely

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=ZOKIl6qWCdLCTPPT@calendula \
    --to=pablo@netfilter.org \
    --cc=netfilter@vger.kernel.org \
    --cc=vesely@tana.it \
    /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.