public inbox for pve-devel@lists.proxmox.com
 help / color / mirror / Atom feed
From: Stefan Hrdlicka <s.hrdlicka@proxmox.com>
To: pve-devel@lists.proxmox.com
Subject: [pve-devel] [PATCH V3 firewall 2/2] cleanup: don't capture "/xx" of CIDR
Date: Tue, 13 Dec 2022 16:14:19 +0100	[thread overview]
Message-ID: <20221213151419.3658005-3-s.hrdlicka@proxmox.com> (raw)
In-Reply-To: <20221213151419.3658005-1-s.hrdlicka@proxmox.com>

Signed-off-by: Stefan Hrdlicka <s.hrdlicka@proxmox.com>
---
 src/PVE/Firewall.pm | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/PVE/Firewall.pm b/src/PVE/Firewall.pm
index ae5f221..4924d51 100644
--- a/src/PVE/Firewall.pm
+++ b/src/PVE/Firewall.pm
@@ -68,7 +68,7 @@ PVE::JSONSchema::register_format('IPorCIDR', \&pve_verify_ip_or_cidr);
 sub pve_verify_ip_or_cidr {
     my ($cidr, $noerr) = @_;
 
-    if ($cidr =~ m!^(?:$IPV6RE|$IPV4RE)(/(\d+))?$!) {
+    if ($cidr =~ m!^(?:$IPV6RE|$IPV4RE)(?:/\d+)?$!) {
         # Net::IP throws an error if the masked CIDR part isn't zero, e.g., `192.168.1.155/24`
         # fails but `192.168.1.0/24` succeeds. clean_cidr removes the non zero bits from the CIDR.
 	my $clean_cidr = clean_cidr($cidr);
-- 
2.30.2





  parent reply	other threads:[~2022-12-13 15:15 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-12-13 15:14 [pve-devel] [PATCH V3 firewall 0/2] allow non zero ip address host bits to be entered Stefan Hrdlicka
2022-12-13 15:14 ` [pve-devel] [PATCH V3 firewall 1/2] " Stefan Hrdlicka
2022-12-13 15:14 ` Stefan Hrdlicka [this message]
2022-12-14 13:42 ` [pve-devel] applied-series: [PATCH V3 firewall 0/2] " Wolfgang Bumiller

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=20221213151419.3658005-3-s.hrdlicka@proxmox.com \
    --to=s.hrdlicka@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