Linux Netfilter development
 help / color / mirror / Atom feed
From: Phil Sutter <phil@nwl.cc>
To: Pablo Neira Ayuso <pablo@netfilter.org>
Cc: netfilter-devel@vger.kernel.org
Subject: Re: [libnftnl PATCH 9/9] udata: Store u32 udata values in Big Endian
Date: Wed, 28 Jan 2026 12:57:20 +0100	[thread overview]
Message-ID: <aXn5oCx0nASLhd_I@orbyte.nwl.cc> (raw)
In-Reply-To: <aXlMqOfp2klbz_bH@chamomile>

Hi Pablo,


On Wed, Jan 28, 2026 at 12:39:20AM +0100, Pablo Neira Ayuso wrote:
> On Thu, Oct 23, 2025 at 06:05:47PM +0200, Phil Sutter wrote:
> > Avoid deviation of this data in between different byte orders. Assume
> > that direct callers of nftnl_udata_put() know what they do.
> 
> How does this work after an update?
> 
> Load ruleset with nft version previous to this, then upgrade, then
> list ruleset with new nft version.

You're right, on LE systems this would interpret LE data as BE. Do we
support this scenario? I vaguely remember a discussion around this topic
with iptables-nft, but don't recall any details.

Without this patch, udata values are in host byteorder. In order to
correctly print them, libnftnl would need to know how data is
structured, which it doesn't and that is by design, right? So the only
alternative to this breakage that I see is to entirely omit userdata
from debug output.

Cheers, Phil

  reply	other threads:[~2026-01-28 11:57 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-10-23 16:05 [libnftnl PATCH 0/9] Fix for debug output on Big Endian Phil Sutter
2025-10-23 16:05 ` [libnftnl PATCH 1/9] set_elem: Review debug output Phil Sutter
2025-10-23 16:05 ` [libnftnl PATCH 2/9] expr: data_reg: Avoid extra whitespace Phil Sutter
2025-10-23 16:05 ` [libnftnl PATCH 3/9] expr: Pass byteorder to struct expr_ops::set callback Phil Sutter
2025-10-23 16:05 ` [libnftnl PATCH 4/9] data_reg: Introduce struct nftnl_data_reg::byteorder field Phil Sutter
2025-10-23 16:05 ` [libnftnl PATCH 5/9] data_reg: Introduce struct nftnl_data_reg::sizes array Phil Sutter
2025-10-23 16:05 ` [libnftnl PATCH 6/9] Introduce nftnl_{expr,set_elem}_set_imm() Phil Sutter
2025-10-23 16:05 ` [libnftnl PATCH 7/9] data_reg: Respect data byteorder when printing Phil Sutter
2025-10-23 16:05 ` [libnftnl PATCH 8/9] data_reg: Support concatenated data Phil Sutter
2025-10-23 16:05 ` [libnftnl PATCH 9/9] udata: Store u32 udata values in Big Endian Phil Sutter
2026-01-27 23:39   ` Pablo Neira Ayuso
2026-01-28 11:57     ` Phil Sutter [this message]
2026-01-27 22:04 ` [libnftnl PATCH 0/9] Fix for debug output on " 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=aXn5oCx0nASLhd_I@orbyte.nwl.cc \
    --to=phil@nwl.cc \
    --cc=netfilter-devel@vger.kernel.org \
    --cc=pablo@netfilter.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