public inbox for pve-devel@lists.proxmox.com
 help / color / mirror / Atom feed
From: Robert Obkircher <r.obkircher@proxmox.com>
To: pve-devel@lists.proxmox.com
Subject: [pve-devel] [PATCH v1 proxmox-firewall] cargo fmt
Date: Tue,  2 Dec 2025 12:25:48 +0100	[thread overview]
Message-ID: <20251202112700.40081-1-r.obkircher@proxmox.com> (raw)

Signed-off-by: Robert Obkircher <r.obkircher@proxmox.com>
---
 proxmox-firewall/src/config.rs   |  2 +-
 proxmox-firewall/src/firewall.rs |  6 +++---
 proxmox-firewall/src/object.rs   |  6 +++---
 proxmox-firewall/src/rule.rs     | 30 ++++++++++++++++--------------
 4 files changed, 23 insertions(+), 21 deletions(-)

diff --git a/proxmox-firewall/src/config.rs b/proxmox-firewall/src/config.rs
index aa8829f..9d82c60 100644
--- a/proxmox-firewall/src/config.rs
+++ b/proxmox-firewall/src/config.rs
@@ -13,8 +13,8 @@ use proxmox_ve_config::firewall::guest::Config as GuestConfig;
 use proxmox_ve_config::firewall::host::Config as HostConfig;
 use proxmox_ve_config::firewall::types::alias::{Alias, AliasScope, RuleAliasName};
 
-use proxmox_ve_config::firewall::types::ipset::{IpsetScope, RuleIpsetName};
 use proxmox_ve_config::firewall::types::Ipset;
+use proxmox_ve_config::firewall::types::ipset::{IpsetScope, RuleIpsetName};
 use proxmox_ve_config::guest::types::Vmid;
 use proxmox_ve_config::guest::{GuestEntry, GuestMap};
 use proxmox_ve_config::host::types::BridgeName;
diff --git a/proxmox-firewall/src/firewall.rs b/proxmox-firewall/src/firewall.rs
index 58f4aec..2dbfef7 100644
--- a/proxmox-firewall/src/firewall.rs
+++ b/proxmox-firewall/src/firewall.rs
@@ -1,7 +1,7 @@
 use std::collections::BTreeMap;
 use std::fs;
 
-use anyhow::{bail, Error};
+use anyhow::{Error, bail};
 
 use proxmox_log as log;
 
@@ -25,17 +25,17 @@ use proxmox_ve_config::firewall::guest::Config as GuestConfig;
 use proxmox_ve_config::firewall::host::Config as HostConfig;
 
 use proxmox_network_types::ip_address::{Cidr, Ipv4Cidr, Ipv6Cidr};
+use proxmox_ve_config::firewall::types::Group;
 use proxmox_ve_config::firewall::types::ipset::{
     Ipfilter, Ipset, IpsetEntry, IpsetName, IpsetScope,
 };
 use proxmox_ve_config::firewall::types::log::{LogLevel as ConfigLogLevel, LogRateLimit};
 use proxmox_ve_config::firewall::types::rule::{Direction, Verdict as ConfigVerdict};
-use proxmox_ve_config::firewall::types::Group;
 use proxmox_ve_config::guest::types::Vmid;
 
 use crate::config::FirewallConfig;
 use crate::object::{NftObjectEnv, ToNftObjects};
-use crate::rule::{generate_verdict, NftRule, NftRuleEnv};
+use crate::rule::{NftRule, NftRuleEnv, generate_verdict};
 
 static CLUSTER_TABLE_NAME: &str = "proxmox-firewall";
 static HOST_TABLE_NAME: &str = "proxmox-firewall";
diff --git a/proxmox-firewall/src/object.rs b/proxmox-firewall/src/object.rs
index 5dde7c2..9438fe3 100644
--- a/proxmox-firewall/src/object.rs
+++ b/proxmox-firewall/src/object.rs
@@ -1,19 +1,19 @@
-use anyhow::{format_err, Error};
+use anyhow::{Error, format_err};
 
 use proxmox_log as log;
 use proxmox_nftables::{
+    Command, Expression,
     command::{Add, Flush},
     expression::Prefix,
     types::{
         AddCtHelper, AddElement, CtHelperProtocol, ElementType, L3Protocol, SetConfig, SetFlag,
         SetName, TablePart,
     },
-    Command, Expression,
 };
 use proxmox_ve_config::{
     firewall::{
         ct_helper::CtHelperMacro,
-        types::{alias::RuleAliasName, ipset::IpsetAddress, Alias, Ipset},
+        types::{Alias, Ipset, alias::RuleAliasName, ipset::IpsetAddress},
     },
     guest::types::Vmid,
 };
diff --git a/proxmox-firewall/src/rule.rs b/proxmox-firewall/src/rule.rs
index 0a4f110..b79f91c 100644
--- a/proxmox-firewall/src/rule.rs
+++ b/proxmox-firewall/src/rule.rs
@@ -1,19 +1,20 @@
 use std::ops::{Deref, DerefMut};
 
-use anyhow::{bail, format_err, Error};
+use anyhow::{Error, bail, format_err};
 
 use proxmox_log as log;
 use proxmox_nftables::{
+    Expression, Statement,
     expression::{Ct, IpFamily, Meta, Payload, Prefix},
     statement::{Log, LogLevel, Match, Operator},
     types::{AddRule, ChainPart, SetName, TableFamily, TablePart},
-    Expression, Statement,
 };
 use proxmox_ve_config::{
     firewall::{
         ct_helper::CtHelperMacro,
-        fw_macros::{get_macro, FwMacro},
+        fw_macros::{FwMacro, get_macro},
         types::{
+            Alias, Ipset, Rule,
             alias::RuleAliasName,
             ipset::{Ipfilter, IpsetName, RuleIpsetName},
             log::LogRateLimit,
@@ -21,7 +22,6 @@ use proxmox_ve_config::{
             rule_match::{
                 Icmp, Icmpv6, IpAddrMatch, IpMatch, Ports, Protocol, RuleMatch, Sctp, Tcp, Udp,
             },
-            Alias, Ipset, Rule,
         },
     },
     guest::types::Vmid,
@@ -812,16 +812,18 @@ impl ToNftRules for Ipfilter<'_> {
                 if env.contains_family(Family::V4) {
                     base_rule.set_family(Family::V4);
 
-                    base_rule.append(&mut vec![Match::new_ne(
-                        Payload::field("arp", "saddr ip"),
-                        Expression::set_name(&SetName::ipset_name(
-                            Family::V4,
-                            self.ipset().name(),
-                            env.vmid,
-                            false,
-                        )),
-                    )
-                    .into()]);
+                    base_rule.append(&mut vec![
+                        Match::new_ne(
+                            Payload::field("arp", "saddr ip"),
+                            Expression::set_name(&SetName::ipset_name(
+                                Family::V4,
+                                self.ipset().name(),
+                                env.vmid,
+                                false,
+                            )),
+                        )
+                        .into(),
+                    ]);
 
                     rules.push(base_rule);
                 }
-- 
2.47.3



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


                 reply	other threads:[~2025-12-02 11:27 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=20251202112700.40081-1-r.obkircher@proxmox.com \
    --to=r.obkircher@proxmox.com \
    --cc=pve-devel@lists.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