all lists on lists.proxmox.com
 help / color / mirror / Atom feed
From: Stefan Hanreich <s.hanreich@proxmox.com>
To: pve-devel@lists.proxmox.com
Subject: [PATCH pve-firewall 1/1] rules: verify no interface is set for rules with direction forward
Date: Fri, 26 Jun 2026 14:20:17 +0200	[thread overview]
Message-ID: <20260626122019.175700-1-s.hanreich@proxmox.com> (raw)

It is not possible to specify the iface option for rules with
direction forward. This has not been verified by the backend, which
made it very easy to accidentally create invalid FORWARD chain rules.

Signed-off-by: Stefan Hanreich <s.hanreich@proxmox.com>
---
 src/PVE/Firewall.pm | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/src/PVE/Firewall.pm b/src/PVE/Firewall.pm
index 93f8c34..3fc692f 100644
--- a/src/PVE/Firewall.pm
+++ b/src/PVE/Firewall.pm
@@ -1842,6 +1842,9 @@ sub verify_rule {
             $add_error->('iface', "value does not match the regex pattern 'net\\d+'")
                 if $rule->{iface} !~ m/^net(\d+)$/;
         }
+
+        $add_error->('iface', "cannot define an interface on rules with direction FORWARD")
+            if $type eq 'forward';
     }
 
     if ($rule->{macro}) {
-- 
2.47.3





                 reply	other threads:[~2026-06-26 12:21 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=20260626122019.175700-1-s.hanreich@proxmox.com \
    --to=s.hanreich@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 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