netfilter-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Fernando Fernandez Mancera <fmancera@suse.de>
To: 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: Thu, 25 Sep 2025 14:36:15 +0200	[thread overview]
Message-ID: <e19bafc0-61c9-47af-afb6-15f886cc4d37@suse.de> (raw)
In-Reply-To: <f2c46dc450b3223834cd837882877f892b234491.camel@scientia.org>



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.

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.

Thanks,
Fernando.

> Maybe one could however always resolv it for lo, if that is truly
> always ID 1, as I've been told.
> 
> 
> Thanks,
> Chris.
> 
> 
> [0] https://lore.kernel.org/netfilter/aNPhP63SyX2ofE92@strlen.de/T/#m15841db7bf5bb588483fdd3576d70af7a71f5555
> 


  reply	other threads:[~2025-09-25 12:36 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 [this message]
2025-09-25 14:07   ` Pablo Neira Ayuso
2025-09-26 10:27     ` Fernando Fernandez Mancera
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=e19bafc0-61c9-47af-afb6-15f886cc4d37@suse.de \
    --to=fmancera@suse.de \
    --cc=calestyo@scientia.org \
    --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;
as well as URLs for NNTP newsgroup(s).