all lists on lists.proxmox.com
 help / color / mirror / Atom feed
* [PATCH proxmox-firewall] nftables: add support for mark-keyed verdict maps
@ 2026-08-27 13:17 Hannes Laimer
  2026-09-23 10:01 ` Stefan Hanreich
  0 siblings, 1 reply; 2+ messages in thread
From: Hannes Laimer @ 2026-08-27 13:17 UTC (permalink / raw)
  To: pve-devel

nftables sets and maps can be keyed by the packet mark, but the mark
element type has not yet been exposed by proxmox-nftables. A vmap
statement could so far only be parsed, not constructed, so the only ones
in use come from the static ruleset skeleton. Add both to the lib.

Signed-off-by: Hannes Laimer <h.laimer@proxmox.com>
---
 proxmox-nftables/src/statement.rs | 9 +++++++++
 proxmox-nftables/src/types.rs     | 1 +
 2 files changed, 10 insertions(+)

diff --git a/proxmox-nftables/src/statement.rs b/proxmox-nftables/src/statement.rs
index 44a4c48..0416623 100644
--- a/proxmox-nftables/src/statement.rs
+++ b/proxmox-nftables/src/statement.rs
@@ -312,6 +312,15 @@ pub struct Vmap {
     data: Expression,
 }
 
+impl Vmap {
+    pub fn new(key: impl Into<Expression>, data: impl Into<Expression>) -> Self {
+        Self {
+            key: key.into(),
+            data: data.into(),
+        }
+    }
+}
+
 #[derive(Clone, Debug, Deserialize, Serialize)]
 pub struct Match {
     op: Operator,
diff --git a/proxmox-nftables/src/types.rs b/proxmox-nftables/src/types.rs
index 86ccaf8..f79229b 100644
--- a/proxmox-nftables/src/types.rs
+++ b/proxmox-nftables/src/types.rs
@@ -56,6 +56,7 @@ pub enum ElementType {
     Ifname,
     Ipv4Addr,
     Ipv6Addr,
+    Mark,
 }
 proxmox_serde::forward_display_to_serialize!(ElementType);
 
-- 
2.47.3





^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH proxmox-firewall] nftables: add support for mark-keyed verdict maps
  2026-08-27 13:17 [PATCH proxmox-firewall] nftables: add support for mark-keyed verdict maps Hannes Laimer
@ 2026-09-23 10:01 ` Stefan Hanreich
  0 siblings, 0 replies; 2+ messages in thread
From: Stefan Hanreich @ 2026-09-23 10:01 UTC (permalink / raw)
  To: pve-devel

lgtm

Reviewed-by: Stefan Hanreich <s.hanreich@proxmox.com>

On 8/27/26 3:18 PM, Hannes Laimer wrote:
> nftables sets and maps can be keyed by the packet mark, but the mark
> element type has not yet been exposed by proxmox-nftables. A vmap
> statement could so far only be parsed, not constructed, so the only ones
> in use come from the static ruleset skeleton. Add both to the lib.
> 
> Signed-off-by: Hannes Laimer <h.laimer@proxmox.com>
> ---
>  proxmox-nftables/src/statement.rs | 9 +++++++++
>  proxmox-nftables/src/types.rs     | 1 +
>  2 files changed, 10 insertions(+)
> 
> diff --git a/proxmox-nftables/src/statement.rs b/proxmox-nftables/src/statement.rs
> index 44a4c48..0416623 100644
> --- a/proxmox-nftables/src/statement.rs
> +++ b/proxmox-nftables/src/statement.rs
> @@ -312,6 +312,15 @@ pub struct Vmap {
>      data: Expression,
>  }
>  
> +impl Vmap {
> +    pub fn new(key: impl Into<Expression>, data: impl Into<Expression>) -> Self {
> +        Self {
> +            key: key.into(),
> +            data: data.into(),
> +        }
> +    }
> +}
> +
>  #[derive(Clone, Debug, Deserialize, Serialize)]
>  pub struct Match {
>      op: Operator,
> diff --git a/proxmox-nftables/src/types.rs b/proxmox-nftables/src/types.rs
> index 86ccaf8..f79229b 100644
> --- a/proxmox-nftables/src/types.rs
> +++ b/proxmox-nftables/src/types.rs
> @@ -56,6 +56,7 @@ pub enum ElementType {
>      Ifname,
>      Ipv4Addr,
>      Ipv6Addr,
> +    Mark,
>  }
>  proxmox_serde::forward_display_to_serialize!(ElementType);
>  





^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2026-09-23 10:01 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-08-27 13:17 [PATCH proxmox-firewall] nftables: add support for mark-keyed verdict maps Hannes Laimer
2026-09-23 10:01 ` Stefan Hanreich

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal