public inbox for pbs-devel@lists.proxmox.com
 help / color / mirror / Atom feed
From: "Fabian Grünbichler" <f.gruenbichler@proxmox.com>
To: pbs-devel@lists.proxmox.com
Subject: [pbs-devel] [PATCH proxmox-backup] fix #4722: allow all netmask values for reverse lookup
Date: Tue,  9 May 2023 11:15:13 +0200	[thread overview]
Message-ID: <20230509091513.224508-1-f.gruenbichler@proxmox.com> (raw)

the only place this is used (parsing a 'netmask XXX' directive in an interfaces
file) allows any integer as value both when parsing and when validating, so
there is no reason to restrict this to only allow string netmasks >=
8/255.0.0.0 as far as I can tell..

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
---
@Dietmar is/was there some reason for this restriction?

 pbs-config/src/network/helper.rs | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/pbs-config/src/network/helper.rs b/pbs-config/src/network/helper.rs
index 02548cf9..7180aaaa 100644
--- a/pbs-config/src/network/helper.rs
+++ b/pbs-config/src/network/helper.rs
@@ -51,7 +51,7 @@ lazy_static! {
     pub static ref IPV4_MASK_HASH_LOCALNET: HashMap<&'static str, u8> = {
         let mut map = HashMap::new();
         #[allow(clippy::needless_range_loop)]
-        for i in 8..32 {
+        for i in 0..IPV4_REVERSE_MASK.len() {
             map.insert(IPV4_REVERSE_MASK[i], i as u8);
         }
         map
-- 
2.30.2





             reply	other threads:[~2023-05-09  9:15 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-05-09  9:15 Fabian Grünbichler [this message]
2023-05-17  9:22 ` [pbs-devel] applied: " Thomas Lamprecht

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=20230509091513.224508-1-f.gruenbichler@proxmox.com \
    --to=f.gruenbichler@proxmox.com \
    --cc=pbs-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