public inbox for pve-devel@lists.proxmox.com
 help / color / mirror / Atom feed
From: Stefan Hanreich <s.hanreich@proxmox.com>
To: pve-devel@lists.proxmox.com
Subject: [pve-devel] [PATCH pve-installer] tui: improve ipv6 handling
Date: Wed, 21 Jun 2023 16:16:49 +0200	[thread overview]
Message-ID: <20230621141649.1062567-1-s.hanreich@proxmox.com> (raw)

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

Signed-off-by: Stefan Hanreich <s.hanreich@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




             reply	other threads:[~2023-06-21 14:16 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-06-21 14:16 Stefan Hanreich [this message]
2023-06-21 15:43 ` [pve-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=20230621141649.1062567-1-s.hanreich@proxmox.com \
    --to=s.hanreich@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