[pbs-devel] [PATCH proxmox-backup] fix #4722: allow all netmask values for reverse lookup

Fabian Grünbichler f.gruenbichler at proxmox.com
Tue May 9 11:15:13 CEST 2023


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 at 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






More information about the pbs-devel mailing list