aboutsummaryrefslogtreecommitdiffstats
path: root/main/util-vserver/setup-vs-guest
diff options
context:
space:
mode:
Diffstat (limited to 'main/util-vserver/setup-vs-guest')
-rw-r--r--main/util-vserver/setup-vs-guest6
1 files changed, 3 insertions, 3 deletions
diff --git a/main/util-vserver/setup-vs-guest b/main/util-vserver/setup-vs-guest
index 2985af96f5..5b71e08067 100644
--- a/main/util-vserver/setup-vs-guest
+++ b/main/util-vserver/setup-vs-guest
@@ -156,9 +156,9 @@ last_ipv4_addr_mask() {
ip addr show dev $_iface | awk '$1 == "inet" {print $2}' | tail -n1
}
-valid_ip() {
+valid_ip_and_prefix() {
[ "$1" ] || return 0
- ipcalc -s $1
+ ipcalc -s -m $1 >/dev/null 2>&1 && ! ipcalc -s -m $1/0 >/dev/null 2>&1
}
# ask for hostname
@@ -208,7 +208,7 @@ ask_ifaceopts() {
_mask=${_last_ip_mask#*/}
while true; do
ask "Enter IP address/mask for $_iface:" $_ip/$_mask
- valid_ip $resp && break
+ valid_ip_and_prefix "$resp" 2>&1 && break
echo "$resp is not a valid IPv4 address/mask"
done
_ip_mask=$resp