summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorOlivier Blin <oblin@mandriva.org>2005-04-05 18:17:57 +0000
committerOlivier Blin <oblin@mandriva.org>2005-04-05 18:17:57 +0000
commit2a6231253a2b22185bb645a79036334776c694a7 (patch)
treefec641ca0ee83df54194766c58910b8a28dbcc77
parent842972c81bbb4b8a77329426dc2116045184f616 (diff)
downloaddrakx-2a6231253a2b22185bb645a79036334776c694a7.tar
drakx-2a6231253a2b22185bb645a79036334776c694a7.tar.gz
drakx-2a6231253a2b22185bb645a79036334776c694a7.tar.bz2
drakx-2a6231253a2b22185bb645a79036334776c694a7.tar.xz
drakx-2a6231253a2b22185bb645a79036334776c694a7.zip
improve wifi detection
-rw-r--r--perl-install/network/tools.pm7
1 files changed, 5 insertions, 2 deletions
diff --git a/perl-install/network/tools.pm b/perl-install/network/tools.pm
index 92fe5f1f6..844ce41b5 100644
--- a/perl-install/network/tools.pm
+++ b/perl-install/network/tools.pm
@@ -257,6 +257,7 @@ sub get_default_gateway_interface {
(find { get_interface_type($intf->{$_}) eq 'adsl' } @intfs) ||
(find { get_interface_type($intf->{$_}) eq 'isdn' && text2bool($intf->{$_}{DIAL_ON_IFUP}) } @intfs) ||
(find { get_interface_type($intf->{$_}) eq 'modem' } @intfs) ||
+ (find { get_interface_type($intf->{$_}) eq 'wifi' && $intf->{$_}{BOOTPROTO} eq 'dhcp' } @intfs) ||
(find { get_interface_type($intf->{$_}) eq 'ethernet' && $intf->{$_}{BOOTPROTO} eq 'dhcp' } @intfs);
}
@@ -277,16 +278,18 @@ sub get_internet_connection {
sub get_interface_type {
my ($interface) = @_;
+ require detect_devices;
member($interface->{TYPE}, "xDSL", "ADSL") && "adsl" ||
- $interface->{DEVICE} =~ /^(eth|ath|wlan)/ && "ethernet" ||
$interface->{DEVICE} =~ /^ippp/ && "isdn" ||
$interface->{DEVICE} =~ /^ppp/ && "modem" ||
+ c::isNetDeviceWirelessAware($interface->{DEVICE}) && "wifi" ||
+ detect_devices::is_lan_interface($interface->{DEVICE}) && "ethernet" ||
"unknown";
}
sub get_default_metric {
my ($type) = @_;
- my @known_types = ("ethernet_gigabit", "ethernet", "adsl", "isdn", "modem", "unknown");
+ my @known_types = ("ethernet_gigabit", "ethernet", "adsl", "wifi", "isdn", "modem", "unknown");
my $idx;
eval { $idx = find_index { $type eq $_ } @known_types };
$idx = @known_types if $@;