From d1ae5335b04dd30597045cb758c1519bbe1cff6c Mon Sep 17 00:00:00 2001 From: Olivier Blin Date: Thu, 8 Dec 2005 12:42:33 +0000 Subject: =?UTF-8?q?fix=20default=20metric=20setting=20for=20wifi=20interfa?= =?UTF-8?q?ces=20(thanks=20to=20Micka=C3=ABl=20Le=20Baillif=20for=20pointi?= =?UTF-8?q?ng=20this=20out)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- perl-install/network/netconnect.pm | 5 ++--- perl-install/network/tools.pm | 5 +++-- 2 files changed, 5 insertions(+), 5 deletions(-) (limited to 'perl-install') diff --git a/perl-install/network/netconnect.pm b/perl-install/network/netconnect.pm index f48872887..3b0fa1153 100644 --- a/perl-install/network/netconnect.pm +++ b/perl-install/network/netconnect.pm @@ -889,9 +889,8 @@ If you do not know it, keep the preselected type."), { pre => sub { $find_lan_module->(); - my $intf_type = member($module, list_modules::category2modules('network/gigabit')) ? "ethernet_gigabit" : "ethernet"; - defined($ethntf->{METRIC}) or $ethntf->{METRIC} = network::tools::get_default_metric($intf_type); - + $ethntf->{METRIC} = network::tools::get_default_metric(network::tools::get_interface_type($ethntf, $module)) + unless defined($ethntf->{METRIC}); $protocol = $l10n_lan_protocols{defined $auto_ip ? ($auto_ip ? 'dhcp' : 'static') : $ethntf->{BOOTPROTO}} || 0; }, name => sub { diff --git a/perl-install/network/tools.pm b/perl-install/network/tools.pm index 9445f6a2b..460797959 100644 --- a/perl-install/network/tools.pm +++ b/perl-install/network/tools.pm @@ -208,13 +208,14 @@ sub get_internet_connection { } sub get_interface_type { - my ($interface) = @_; + my ($interface, $o_module) = @_; require detect_devices; member($interface->{TYPE}, "xDSL", "ADSL") && "adsl" || $interface->{DEVICE} =~ /^ippp/ && "isdn" || $interface->{DEVICE} =~ /^ppp/ && "modem" || (detect_devices::is_wireless_interface($interface->{DEVICE}) || exists $interface->{WIRELESS_MODE}) && "wifi" || - detect_devices::is_lan_interface($interface->{DEVICE}) && "ethernet" || + detect_devices::is_lan_interface($interface->{DEVICE}) && + ($o_module && member($o_module, list_modules::category2modules('network/gigabit')) ? "ethernet_gigabit" : "ethernet") || "unknown"; } -- cgit v1.2.1