From: Phil Sutter <phil@nwl.cc>
To: Jeremy Sowden <jeremy@azazel.net>
Cc: netfilter-devel@vger.kernel.org
Subject: Re: [nft PATCH 0/2] A bit of non-constant binop follow-up
Date: Sat, 4 Apr 2026 11:32:51 +0200 [thread overview]
Message-ID: <adDaw2nCXsDPHHyE@orbyte.nwl.cc> (raw)
In-Reply-To: <20260403155314.GC5449@celephais.dreamlands>
On Fri, Apr 03, 2026 at 04:53:14PM +0100, Jeremy Sowden wrote:
> On 2026-04-02, at 20:43:18 +0200, Phil Sutter wrote:
> > When asked about how to translate ebtables' --arp-gratuitous match, I
> > noticed that basically everything is there already but the parser
> > rejects it.
> >
> > While we can't do a simple 'arp saddr ip == arp daddr ip' because cmp
> > expression requires for one side of the equation to be constant, using
> > XOR on LHS we can work around this limitation:
> >
> > arp saddr ip ^ arp daddr ip == 0.0.0.0
> >
> > Thanks to Jeremy's work on bitwise expression (which one might want to
> > repeat for cmp),
>
> I'll take a look. :)
Cool, thanks! The ability for cmp to operate on two registers instead of
one register and payload ("data reg") would allow user space to
implement the above as 'arp saddr ip == arp daddr ip' (without the need
for an internal conversion into XOR). It is not a short-term solution
though due to the needed kernel support.
Cheers, Phil
prev parent reply other threads:[~2026-04-04 9:32 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-04-02 18:43 [nft PATCH 0/2] A bit of non-constant binop follow-up Phil Sutter
2026-04-02 18:43 ` [nft PATCH 1/2] parser_json: Accept non-RHS expressions in binop RHS Phil Sutter
2026-04-02 18:43 ` [nft PATCH 2/2] parser_bison: Accept non-constant binop on LHS of relationals Phil Sutter
2026-04-03 15:53 ` [nft PATCH 0/2] A bit of non-constant binop follow-up Jeremy Sowden
2026-04-04 9:32 ` Phil Sutter [this message]
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=adDaw2nCXsDPHHyE@orbyte.nwl.cc \
--to=phil@nwl.cc \
--cc=jeremy@azazel.net \
--cc=netfilter-devel@vger.kernel.org \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox