public inbox for pve-devel@lists.proxmox.com
 help / color / mirror / Atom feed
From: Gabriel Goller <g.goller@proxmox.com>
To: Thomas Lamprecht <t.lamprecht@proxmox.com>
Cc: Proxmox VE development discussion <pve-devel@lists.proxmox.com>
Subject: Re: [pve-devel] [PATCH ve-rs 1/2] fix: firewall: introduce iptables to nftables mapping for icmpv6-types
Date: Mon, 6 Oct 2025 12:13:24 +0200	[thread overview]
Message-ID: <xyd6dzfcnygwh6mbpwxc2hpk23vjjhg5kdd2gobgscee6elmj5@khw4sgf6puem> (raw)
In-Reply-To: <c2da3a30-93c8-4d76-917f-814fab9c9173@proxmox.com>

On 04.10.2025 15:17, Thomas Lamprecht wrote:
>Am 16.09.25 um 11:32 schrieb Gabriel Goller:
>> +        if let Ok(index) = IPTABLES_ICMP_TYPES_MAPPING.binary_search_by(|v| v.0.cmp(s)) {
>> +            if let Some(mapped_nftables_type) = IPTABLES_ICMP_TYPES_MAPPING[index].1 {
>> +                return Ok(Self::Named(mapped_nftables_type));
>> +            } else {
>> +                bail!("icmp_type {s:?} is unsupported in nftables");
>
>How is this Err handled on use sites? As for the bail below I'd be fine
>if it causes some further failure down the road, but if it is a supported
>type in pve-firewall above should not cause any actual error or rule
>generations to get skipped, besides skipping the nftables-unsupported
>ones, obviously.

Yeah you're right, I forgot that erroring here in the firewall is not
good; i.e. you only get the error in the journal and no firewall code is
generated.

>Also, the linked wiki spots "Last update: Mar/2022" at the top, so a bit
>dated. Did you actually try if this is still the case for all of the
>listed ones?

Yep, it's still just the listed ones. But the other ones can actually be
implemented as a custom type/code combination, so that we have full coverage.

To be exact, iptables has a few types that can be specified as strings,
but actually correspond to a type and a specific code, e.g.:
'port-unreachable' corresponds to type 3 and code 3,
'destination-unreachable' corresponds to type 3 (and no code), which
means it contains 'port-unreachable'. In nftables they did it right and
completely separated the type and code properties.

For more info see here: https://www.iana.org/assignments/icmpv6-parameters/icmpv6-parameters.xhtml#icmpv6-parameters-2

>> +            }
>> +        }
>> +
>>          bail!("{s:?} is not a valid icmpv6 type");
>>      }
>

Thanks for the review!


_______________________________________________
pve-devel mailing list
pve-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel


  reply	other threads:[~2025-10-06 10:14 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-09-16  9:31 [pve-devel] [PATCH proxmox-firewall/ve-rs 0/3] Fix ICMPv6 types in nftables Gabriel Goller
2025-09-16  9:31 ` [pve-devel] [PATCH ve-rs 1/2] fix: firewall: introduce iptables to nftables mapping for icmpv6-types Gabriel Goller
2025-10-01 16:46   ` Stefan Hanreich
2025-10-06 10:14     ` Gabriel Goller
2025-10-04 13:17   ` Thomas Lamprecht
2025-10-06 10:13     ` Gabriel Goller [this message]
2025-09-16  9:31 ` [pve-devel] [PATCH ve-rs 2/2] firewall: correctly return errors when parsing icmpv6 types and codes Gabriel Goller
2025-09-16  9:31 ` [pve-devel] [PATCH proxmox-firewall 1/1] tests: add icmpv6 type mapping test Gabriel Goller

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=xyd6dzfcnygwh6mbpwxc2hpk23vjjhg5kdd2gobgscee6elmj5@khw4sgf6puem \
    --to=g.goller@proxmox.com \
    --cc=pve-devel@lists.proxmox.com \
    --cc=t.lamprecht@proxmox.com \
    /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
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal