From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from firstgate.proxmox.com (firstgate.proxmox.com [IPv6:2a01:7e0:0:424::9]) by lore.proxmox.com (Postfix) with ESMTPS id 16AFE1FF187 for ; Mon, 6 Oct 2025 12:14:03 +0200 (CEST) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id EA92527C2C; Mon, 6 Oct 2025 12:14:03 +0200 (CEST) Date: Mon, 6 Oct 2025 12:13:24 +0200 From: Gabriel Goller To: Thomas Lamprecht Message-ID: Mail-Followup-To: Thomas Lamprecht , Proxmox VE development discussion References: <20250916093116.114942-1-g.goller@proxmox.com> <20250916093116.114942-2-g.goller@proxmox.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: User-Agent: NeoMutt/20241002-35-39f9a6 X-Bm-Milter-Handled: 55990f41-d878-4baa-be0a-ee34c49e34d2 X-Bm-Transport-Timestamp: 1759745576168 X-SPAM-LEVEL: Spam detection results: 0 AWL -0.003 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% DMARC_MISSING 0.1 Missing DMARC policy KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment RCVD_IN_VALIDITY_CERTIFIED_BLOCKED 0.001 ADMINISTRATOR NOTICE: The query to Validity was blocked. See https://knowledge.validity.com/hc/en-us/articles/20961730681243 for more information. RCVD_IN_VALIDITY_RPBL_BLOCKED 0.001 ADMINISTRATOR NOTICE: The query to Validity was blocked. See https://knowledge.validity.com/hc/en-us/articles/20961730681243 for more information. RCVD_IN_VALIDITY_SAFE_BLOCKED 0.001 ADMINISTRATOR NOTICE: The query to Validity was blocked. See https://knowledge.validity.com/hc/en-us/articles/20961730681243 for more information. SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record Subject: Re: [pve-devel] [PATCH ve-rs 1/2] fix: firewall: introduce iptables to nftables mapping for icmpv6-types X-BeenThere: pve-devel@lists.proxmox.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Proxmox VE development discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: Proxmox VE development discussion Cc: Proxmox VE development discussion Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="us-ascii"; Format="flowed" Errors-To: pve-devel-bounces@lists.proxmox.com Sender: "pve-devel" 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