[pve-devel] [PATCH pve-installer] tui: improve ipv6 handling

Stefan Hanreich s.hanreich at proxmox.com
Wed Jun 21 16:16:49 CEST 2023


* fix detection of ipv6 addresses
* change input for CIDR to allow integers up until 128

Signed-off-by: Stefan Hanreich <s.hanreich at proxmox.com>
---
 proxmox-tui-installer/src/utils.rs     | 2 +-
 proxmox-tui-installer/src/views/mod.rs | 6 +++---
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/proxmox-tui-installer/src/utils.rs b/proxmox-tui-installer/src/utils.rs
index c4b7c03..3245fac 100644
--- a/proxmox-tui-installer/src/utils.rs
+++ b/proxmox-tui-installer/src/utils.rs
@@ -65,7 +65,7 @@ impl CidrAddress {
 
     /// Returns `true` if this address is an IPv6 address, `false` otherwise.
     pub fn is_ipv6(&self) -> bool {
-        self.addr.is_ipv4()
+        self.addr.is_ipv6()
     }
 
     /// Returns only the mask part of the address.
diff --git a/proxmox-tui-installer/src/views/mod.rs b/proxmox-tui-installer/src/views/mod.rs
index 4160b8f..dc58043 100644
--- a/proxmox-tui-installer/src/views/mod.rs
+++ b/proxmox-tui-installer/src/views/mod.rs
@@ -387,10 +387,10 @@ impl CidrAddressEditView {
 
     fn mask_edit_view(content: usize) -> ResizedView<IntegerEditView> {
         IntegerEditView::new()
-            .max_value(32)
-            .max_content_width(2)
+            .max_value(128)
+            .max_content_width(3)
             .content(content)
-            .fixed_width(3)
+            .fixed_width(4)
     }
 
     fn get_values(&self) -> Option<CidrAddress> {
-- 
2.39.2





More information about the pve-devel mailing list