public inbox for pbs-devel@lists.proxmox.com
 help / color / mirror / Atom feed
* [pbs-devel] [PATCH proxmox-backup] fix #4722: allow all netmask values for reverse lookup
@ 2023-05-09  9:15 Fabian Grünbichler
  2023-05-17  9:22 ` [pbs-devel] applied: " Thomas Lamprecht
  0 siblings, 1 reply; 2+ messages in thread
From: Fabian Grünbichler @ 2023-05-09  9:15 UTC (permalink / raw)
  To: pbs-devel

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





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

* [pbs-devel] applied: [PATCH proxmox-backup] fix #4722: allow all netmask values for reverse lookup
  2023-05-09  9:15 [pbs-devel] [PATCH proxmox-backup] fix #4722: allow all netmask values for reverse lookup Fabian Grünbichler
@ 2023-05-17  9:22 ` Thomas Lamprecht
  0 siblings, 0 replies; 2+ messages in thread
From: Thomas Lamprecht @ 2023-05-17  9:22 UTC (permalink / raw)
  To: Proxmox Backup Server development discussion, Fabian Grünbichler

Am 09/05/2023 um 11:15 schrieb Fabian Grünbichler:
> 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?


makes no sense to me to limit that...

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

applied, thanks!




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

end of thread, other threads:[~2023-05-17  9:22 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-05-09  9:15 [pbs-devel] [PATCH proxmox-backup] fix #4722: allow all netmask values for reverse lookup Fabian Grünbichler
2023-05-17  9:22 ` [pbs-devel] applied: " Thomas Lamprecht

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