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 0/9] Fix for debug output on Big Endian
Date: Tue, 27 Jan 2026 23:04:08 +0100	[thread overview]
Message-ID: <aXk2WCle6ES3iAIr@orbyte.nwl.cc> (raw)
In-Reply-To: <20251023160547.10928-1-phil@nwl.cc>

On Thu, Oct 23, 2025 at 06:05:38PM +0200, Phil Sutter wrote:
> This series aims at providing identical netlink debug output in nftables
> on Big and Little Endian systems. Particularly problematic are all data
> regs in host byte order, worsened by the potential for byte order swaps
> within a single data reg (concatenated set elements).
> 
> A bonus task is cropping data reg values to their actual size.
> Previously, every four-byte register containing data was printed which
> further reduces data expressiveness.
> 
> This series introduces data attribute setters for expressions and set
> elements which accept a byteorder value (plus an array of component
> sizes in the latter case) and changes the data reg printer to:
> 
> - Print only nftnl_data_reg::len bytes at max
> - Print data byte-by-byte, not four byte chunks as u32 values
>   interpreted in host byte order
> - Print data in reverse if in host byte order on Little Endian
> 
> If nftnl_data_reg::sizes array has non-zero fields, data is assumed to
> be concatenated and bits in nftnl_data_reg::byteorder signal host byte
> order in components. Each component is then printed as per the above
> rules and separated by a dot (".").
> 
> Patches 3-8 implement the above. Since debug output changes
> significantly, use the occasion to:
> - Print a colon (":") and flags value only if relevant (patch 1)
> - Fix for missing object name in objmap elements (patch 1)
> - Avoid ambiguity between data and flags value by prefixing with 'flags'
>   (patch 1)
> - Avoid trailing whitespace or space before tab (patch 2)
> 
> Finally, patch 8 tries to avoid userdata values in host byte order by
> storing u32 values in Big Endian. Since nftnl_udata_put_u32() is the
> only typed attribute setter (apart from the unproblematic strz one),
> this may be good enough for the purpose.
> 
> Phil Sutter (9):
>   set_elem: Review debug output
>   expr: data_reg: Avoid extra whitespace
>   expr: Pass byteorder to struct expr_ops::set callback
>   data_reg: Introduce struct nftnl_data_reg::byteorder field
>   data_reg: Introduce struct nftnl_data_reg::sizes array
>   Introduce nftnl_{expr,set_elem}_set_imm()
>   data_reg: Respect data byteorder when printing
>   data_reg: Support concatenated data
>   udata: Store u32 udata values in Big Endian

Series applied.

      parent reply	other threads:[~2026-01-27 22:04 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
2026-01-27 22:04 ` 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=aXk2WCle6ES3iAIr@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