From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from firstgate.proxmox.com (firstgate.proxmox.com [212.224.123.68]) by lore.proxmox.com (Postfix) with ESMTPS id 377DA1FF178 for ; Mon, 15 Dec 2025 16:09:17 +0100 (CET) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 26B81100C1; Mon, 15 Dec 2025 16:09:52 +0100 (CET) From: Robert Obkircher To: pve-devel@lists.proxmox.com Date: Mon, 15 Dec 2025 16:08:48 +0100 Message-ID: <20251215150906.257151-5-r.obkircher@proxmox.com> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20251215150906.257151-1-r.obkircher@proxmox.com> References: <20251215150906.257151-1-r.obkircher@proxmox.com> MIME-Version: 1.0 X-Bm-Milter-Handled: 55990f41-d878-4baa-be0a-ee34c49e34d2 X-Bm-Transport-Timestamp: 1765811382584 X-SPAM-LEVEL: Spam detection results: 0 AWL 0.062 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 SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record Subject: [pve-devel] [PATCH proxmox-ve-rs 1/1] firewall: parse preserve_comments host firewall option 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 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: pve-devel-bounces@lists.proxmox.com Sender: "pve-devel" Signed-off-by: Robert Obkircher --- proxmox-ve-config/src/firewall/host.rs | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/proxmox-ve-config/src/firewall/host.rs b/proxmox-ve-config/src/firewall/host.rs index d749442..01ffca2 100644 --- a/proxmox-ve-config/src/firewall/host.rs +++ b/proxmox-ve-config/src/firewall/host.rs @@ -34,6 +34,8 @@ pub const HOST_BLOCK_INVALID_TCP_DEFAULT: bool = false; pub const HOST_BLOCK_INVALID_CONNTRACK: bool = false; /// default setting for logging of invalid conntrack entries pub const HOST_LOG_INVALID_CONNTRACK: bool = false; +/// default setting for preserve_comments +pub const HOST_PRESERVE_COMMENTS_DEFAULT: bool = false; #[derive(Debug, Default, Deserialize)] #[cfg_attr(test, derive(Eq, PartialEq))] @@ -82,6 +84,9 @@ pub struct Options { #[serde(default, deserialize_with = "proxmox_serde::perl::deserialize_bool")] tcpflags: Option, + + #[serde(default, deserialize_with = "proxmox_serde::perl::deserialize_bool")] + preserve_comments: Option, } #[derive(Debug, Default)] @@ -274,6 +279,13 @@ impl Config { Direction::Forward => self.config.options.log_level_forward.unwrap_or_default(), } } + + pub fn preserve_comments(&self) -> bool { + self.config + .options + .preserve_comments + .unwrap_or(HOST_PRESERVE_COMMENTS_DEFAULT) + } } #[cfg(test)] @@ -309,6 +321,7 @@ protection_synflood_rate: 300 smurf_log_level: notice tcp_flags_log_level: nolog tcpflags: yes +preserve_comments: 1 [RULES] @@ -342,6 +355,7 @@ IN ACCEPT -p udp -dport 33 -sport 22 -log warning smurf_log_level: Some(LogLevel::Notice), tcp_flags_log_level: Some(LogLevel::Nolog), tcpflags: Some(true), + preserve_comments: Some(true), } ); -- 2.47.3 _______________________________________________ pve-devel mailing list pve-devel@lists.proxmox.com https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel