diff options
Diffstat (limited to 'perl-install/network')
-rw-r--r-- | perl-install/network/netconnect.pm | 10 | ||||
-rw-r--r-- | perl-install/network/network.pm | 7 | ||||
-rw-r--r-- | perl-install/network/tools.pm | 8 |
3 files changed, 13 insertions, 12 deletions
diff --git a/perl-install/network/netconnect.pm b/perl-install/network/netconnect.pm index 3ba28075f..a3ad0ab47 100644 --- a/perl-install/network/netconnect.pm +++ b/perl-install/network/netconnect.pm @@ -115,19 +115,19 @@ sub init_globals { } sub main { - my ($prefix, $netcnx, $netc, $mouse, $in, $intf, $first_time, $_direct_fr, $noauto) = @_; + my ($prefix, $netcnx, $netc, $mouse, $in, $intf, $first_time, $_direct_fr, $o_noauto) = @_; init_globals($in, $prefix); $netc->{minus_one} = 0; #When one configure an eth in dhcp without gateway $::isStandalone and read_net_conf($prefix, $netcnx, $netc); # REDONDANCE with intro. FIXME $netc->{NET_DEVICE} = $netcnx->{NET_DEVICE} if $netcnx->{NET_DEVICE}; # REDONDANCE with read_conf. FIXME $netc->{NET_INTERFACE} = $netcnx->{NET_INTERFACE} if $netcnx->{NET_INTERFACE}; # REDONDANCE with read_conf. FIXME - network::network::read_all_conf($prefix, $netc ||= {}, $intf ||= {}); + network::network::read_all_conf($prefix, $netc, $intf); modules::mergein_conf("$prefix/etc/modules.conf"); my $direct_net_install; if ($first_time && $::isInstall && ($in->{method} eq "ftp" || $in->{method} eq "http" || $in->{method} eq "nfs")) { - !$::expert && !$noauto || $in->ask_okcancel(N("Network Configuration"), + !$::expert && !$o_noauto || $in->ask_okcancel(N("Network Configuration"), N("Because you are doing a network installation, your network is already configured. Click on Ok to keep your configuration, or cancel to reconfigure your Internet & Network connection. "), 1) and do { @@ -374,8 +374,8 @@ ADSLLogin=$adsl->{login} } sub set_profile { - my ($netcnx, $profile) = @_; - $profile ||= $netcnx->{PROFILE}; + my ($netcnx, $o_profile) = @_; + my $profile = $o_profile || $netcnx->{PROFILE}; $profile or return; my $f = "$prefix/etc/sysconfig/network-scripts/drakconnect_conf"; -e ($f . "." . $profile) or return; diff --git a/perl-install/network/network.pm b/perl-install/network/network.pm index df209fb35..977122fa8 100644 --- a/perl-install/network/network.pm +++ b/perl-install/network/network.pm @@ -253,7 +253,7 @@ sub is_domain_name { sub netmask { my ($ip) = @_; return "255.255.255.0" unless is_ip($ip); - $ip =~ $ip_regexp; + $ip =~ $ip_regexp or warn "IP_regexp failed\n" and return "255.255.255.0"; if ($1 >= 1 && $1 < 127) { "255.0.0.0"; #-1.0.0.0 to 127.0.0.0 } elsif ($1 >= 128 && $1 <= 191) { @@ -461,8 +461,9 @@ sub proxy_configure { } sub read_all_conf { - my ($prefix, $netc, $intf, $netcnx) = @_; - $netc ||= {}; $intf ||= {}; $netcnx ||= {}; + my ($prefix, $netc, $intf, $o_netcnx) = @_; + $netc ||= {}; $intf ||= {}; + my $netcnx = $o_netcnx || {}; add2hash($netc, read_conf("$prefix/etc/sysconfig/network")) if -r "$prefix/etc/sysconfig/network"; add2hash($netc, read_resolv_conf()); add2hash($netc, read_tmdns_conf("$prefix/etc/tmdns.conf")) if -r "$prefix/etc/tmdns.conf"; diff --git a/perl-install/network/tools.pm b/perl-install/network/tools.pm index 19921b5d0..bba757950 100644 --- a/perl-install/network/tools.pm +++ b/perl-install/network/tools.pm @@ -13,10 +13,10 @@ use MDK::Common::System qw(getVarsFromSh); @EXPORT_OK = qw($in); sub write_cnx_script { - my ($netc, $type, $up, $down, $type2) = @_; - if ($type) { - $netc->{internet_cnx}{$type}{$_->[0]} = $_->[1] foreach [$connect_file, $up], [$disconnect_file, $down]; - $netc->{internet_cnx}{$type}{type} = $type2; + my ($netc, $o_type, $o_up, $o_down, $o_type2) = @_; + if ($o_type) { + $netc->{internet_cnx}{$o_type}{$_->[0]} = $_->[1] foreach [$connect_file, $o_up], [$disconnect_file, $o_down]; + $netc->{internet_cnx}{$o_type}{type} = $o_type2; } else { foreach ($connect_file, $disconnect_file) { output_with_perm("$prefix$_", 0755, |