All of lore.kernel.org
 help / color / mirror / Atom feed
From: Fernando Fernandez Mancera <fmancera@suse.de>
To: Pablo Neira Ayuso <pablo@netfilter.org>
Cc: Christoph Anton Mitterer <calestyo@scientia.org>,
	netfilter-devel@vger.kernel.org
Subject: Re: bug: nft -n still shows "resolved" values for iif and oif
Date: Fri, 26 Sep 2025 12:27:13 +0200	[thread overview]
Message-ID: <6dae9b49-e2e3-4e62-abe7-e46cc2176435@suse.de> (raw)
In-Reply-To: <aNVMqSlTNkGFRoPR@calendula>



On 9/25/25 4:07 PM, Pablo Neira Ayuso wrote:
> On Thu, Sep 25, 2025 at 02:36:15PM +0200, Fernando Fernandez Mancera wrote:
>>
>>
>> On 9/24/25 11:48 PM, Christoph Anton Mitterer wrote:
>>> Hey.
>>>
>>> E.g.:
>>> # nft list ruleset
>>> table inet filter {
>>> 	chain input {
>>> 		type filter hook input priority filter; policy drop;
>>> 		ct state { established, related } accept
>>> 		iif "eth0" accept
>>> 	}
>>> }
>>> #  nft -n list ruleset
>>> table inet filter {
>>> 	chain input {
>>> 		type filter hook input priority 0; policy drop;
>>> 		ct state { 0x2, 0x4 } accept
>>> 		iif "eth0" accept
>>> 	}
>>> }
>>>
>>>
>>> IMO especially for iif/oif, which hardcode the iface ID rather than
>>> name, it would IMO be rather important to show the real value (that is
>>> the ID) and not the resolved one... so that users aren't tricked into
>>> some false sense (when they should actually use [io]ifname.
>>>
>>
>> Hi,
>>
>> AFAICS, the current -n is just a combination of '--numeric-priority
>> --numeric-protocol --numeric-time'. Although, the message displayed when
>> using --help is misleading.
>>
>> -n, --numeric                   Print fully numerical output.
>>
>> I propose two changes:
>>
>> 1. Adjust the description when doing --help
>> 2. Introduce a new "--numeric-interface" which prevents resolving iif or
>> oif.
> 
> I wonder if there is a use-case for this.
> 
>> Another possible solution could be to use --numeric to do not resolve
>> iif/oif but then it would mean we should not resolve ANYTHING as "Print
>> fully numerical output." mentions.
>>
>> What do you think? I can send a patch and test it.
> 
> It would good to check if there are more datatypes that are hiding a
> number value behind to decide what to do with -n/--numeric.
> 

After inspecting the different datatypes:

- verdict (I do not think it makes sense to not resolve this one)
- tchandle (it resolves TC_H_ROOT and TC_H_UNSPEC)
- iif/oif
- ct_label (I think this isn't useful in numeric value)

I do not think there is an use-case for --numeric-interface other than 
just showing the id configured. Maybe we can honor the description of 
--numeric and handle iif/oif and tchandle when using it?

  reply	other threads:[~2025-09-26 10:27 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-09-24 21:48 bug: nft -n still shows "resolved" values for iif and oif Christoph Anton Mitterer
2025-09-25 12:36 ` Fernando Fernandez Mancera
2025-09-25 14:07   ` Pablo Neira Ayuso
2025-09-26 10:27     ` Fernando Fernandez Mancera [this message]
2025-09-25 15:48   ` Christoph Anton Mitterer
2025-09-25 14:42 ` Florian Westphal
2025-09-25 15:53   ` Christoph Anton Mitterer
2025-09-25 16:45     ` Florian Westphal
2025-09-25 20:44       ` Christoph Anton Mitterer

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=6dae9b49-e2e3-4e62-abe7-e46cc2176435@suse.de \
    --to=fmancera@suse.de \
    --cc=calestyo@scientia.org \
    --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 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.