All of lore.kernel.org
 help / color / mirror / Atom feed
From: Phil Sutter <phil@nwl.cc>
To: Jeremy Sowden <jeremy@azazel.net>
Cc: Netfilter Devel <netfilter-devel@vger.kernel.org>,
	Pablo Neira Ayuso <pablo@netfilter.org>
Subject: Re: [PATCH iptables] ip[6]tables-translate: fix test failures when WESP is defined
Date: Fri, 8 Nov 2024 23:45:11 +0100	[thread overview]
Message-ID: <Zy6Ud5mcWI0v3kvF@orbyte.nwl.cc> (raw)
In-Reply-To: <20241108173443.4146022-1-jeremy@azazel.net>

Hi Jeremy,

On Fri, Nov 08, 2024 at 05:34:43PM +0000, Jeremy Sowden wrote:
> Protocol number 141 is assigned to a real protocol: Wrapped Encapsulating
> Security Payload.  This is listed in Debian's /etc/protocols, which leads to
> test failures:
> 
>   ./extensions/generic.txlate: Fail
>   src: iptables-translate -A FORWARD -p 141
>   exp: nft 'add rule ip filter FORWARD ip protocol 141 counter'
>   res: nft 'add rule ip filter FORWARD ip protocol wesp counter'
> 
>   ./extensions/generic.txlate: Fail
>   src: ip6tables-translate -A FORWARD -p 141
>   exp: nft 'add rule ip6 filter FORWARD meta l4proto 141 counter'
>   res: nft 'add rule ip6 filter FORWARD meta l4proto wesp counter'
> 
>   ./extensions/generic.txlate: Fail
>   src: iptables-translate -A FORWARD ! -p 141
>   exp: nft 'add rule ip filter FORWARD ip protocol != 141 counter'
>   res: nft 'add rule ip filter FORWARD ip protocol != wesp counter'
> 
>   ./extensions/generic.txlate: Fail
>   src: ip6tables-translate -A FORWARD ! -p 141
>   exp: nft 'add rule ip6 filter FORWARD meta l4proto != 141 counter'
>   res: nft 'add rule ip6 filter FORWARD meta l4proto != wesp counter'
> 
> Replace it with 253, which IANA reserves for testing and experimentation.

An interesting solution, thanks!

We noticed the problem while preparing for the release already. It
should have been clear that people integrating the new release will run
the testsuite and require a solution, therefore working around it
locally wasn't a feasible way to deal with the situation.

Some other options which came up:

* Make xtables-translate behave like xtables-save, i.e. avoid
  /etc/protocol lookups altogether and print names only if known
  internally (iptables needs some for automatic "protocol extension"
  lookup, like with e.g. '-p 6 --dport 23').

* Print whatever the user specified (we store the -p argument and only
  make it all lower-case). so '-p 6' remains 'ip protocol 6' and '-p
  tcp' remains 'ip protocol tcp'.

* Support --numeric option in iptables-translate to make behaviour
  configurable. Needs quite some hacking as the option is only allowed
  with iptables --list.

What's your take on this?

Thanks, Phil

  reply	other threads:[~2024-11-08 22:45 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-11-08 17:34 [PATCH iptables] ip[6]tables-translate: fix test failures when WESP is defined Jeremy Sowden
2024-11-08 22:45 ` Phil Sutter [this message]
2024-11-11  9:59 ` Pablo Neira Ayuso
2024-11-12 14:11 ` 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=Zy6Ud5mcWI0v3kvF@orbyte.nwl.cc \
    --to=phil@nwl.cc \
    --cc=jeremy@azazel.net \
    --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.