summaryrefslogtreecommitdiffstats
path: root/perl-install/standalone/drakconnect
diff options
context:
space:
mode:
authorOlivier Blin <oblin@mandriva.org>2005-02-28 17:27:45 +0000
committerOlivier Blin <oblin@mandriva.org>2005-02-28 17:27:45 +0000
commit98bd08f67e91821bebbbce286edc364b4d2343d1 (patch)
tree6d2dfa31412cc767e94384a4a903ef7e65d32b05 /perl-install/standalone/drakconnect
parent515e40ffa6b4944118e7d60534b2f52f808d91a9 (diff)
downloaddrakx-backup-do-not-use-98bd08f67e91821bebbbce286edc364b4d2343d1.tar
drakx-backup-do-not-use-98bd08f67e91821bebbbce286edc364b4d2343d1.tar.gz
drakx-backup-do-not-use-98bd08f67e91821bebbbce286edc364b4d2343d1.tar.bz2
drakx-backup-do-not-use-98bd08f67e91821bebbbce286edc364b4d2343d1.tar.xz
drakx-backup-do-not-use-98bd08f67e91821bebbbce286edc364b4d2343d1.zip
enhance "wrong network mask format" message (#10712)
Diffstat (limited to 'perl-install/standalone/drakconnect')
-rwxr-xr-xperl-install/standalone/drakconnect19
1 files changed, 11 insertions, 8 deletions
diff --git a/perl-install/standalone/drakconnect b/perl-install/standalone/drakconnect
index 7c0bb908a..0e02f2e4d 100755
--- a/perl-install/standalone/drakconnect
+++ b/perl-install/standalone/drakconnect
@@ -646,19 +646,22 @@ sub save_notebook {
$intf->{BOOTPROTO} = { reverse %{$proto->{protocols}} }->{$proto->get_text};
}
if ($intf->{BOOTPROTO} eq 'static') {
- check_field($intf, 'IPADDR', 'NETMASK') or $in->ask_warn(N("Error"), N("IP address should be in format 1.2.3.4")) and return 0;
+ if (!is_ip($intf->{IPADDR})) {
+ $in->ask_warn(N("Error"), N("IP address should be in format 1.2.3.4"));
+ return 0;
+ }
+ if (!is_ip($intf->{NETMASK})) {
+ $in->ask_warn(N("Error"), N("Netmask address should be in format 255.255.224.0"));
+ return 0;
+ }
}
- if ($netc->{GATEWAY}) {
- check_field($netc, 'GATEWAY') or $in->ask_warn(N("Error"), N("Gateway address should be in format 1.2.3.4")) and return 0;
+ if ($netc->{GATEWAY} && !is_ip($netc->{GATEWAY})) {
+ $in->ask_warn(N("Error"), N("Gateway address should be in format 1.2.3.4"));
+ return 0;
}
1;
}
-sub check_field {
- my ($field, @ip) = @_;
- (map { if_(!is_ip($field->{$_}), 1) } @ip) ? 0 : 1;
-}
-
sub add_intf() {
$::isWizard = 1;
network::netconnect::main($netcnx, $in, $modules_conf, $netc, undef, $intf);