Signed-off-by: Robert Obkircher <[email protected]>
---
 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<bool>,
+
+    #[serde(default, deserialize_with = 
"proxmox_serde::perl::deserialize_bool")]
+    preserve_comments: Option<bool>,
 }
 
 #[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
[email protected]
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel

Reply via email to