summaryrefslogtreecommitdiffstats
path: root/perl-install
diff options
context:
space:
mode:
authorThierry Vignaud <tvignaud@mandriva.org>2005-03-09 12:06:09 +0000
committerThierry Vignaud <tvignaud@mandriva.org>2005-03-09 12:06:09 +0000
commitab16a4bc28eaa33339b6828d2eda6871517840f4 (patch)
treedd7ba2e4adee2e9aa57a9cbf5696cf2f62e02a16 /perl-install
parentb82b707eeeac2cfb343385e895d527303fa75b08 (diff)
downloaddrakx-ab16a4bc28eaa33339b6828d2eda6871517840f4.tar
drakx-ab16a4bc28eaa33339b6828d2eda6871517840f4.tar.gz
drakx-ab16a4bc28eaa33339b6828d2eda6871517840f4.tar.bz2
drakx-ab16a4bc28eaa33339b6828d2eda6871517840f4.tar.xz
drakx-ab16a4bc28eaa33339b6828d2eda6871517840f4.zip
(get_eth_cards) do not overwrite driver name with sysfs one when we
already got it from ethtool, thus fixing bogus names registered though pci layer in kernel (#14163)
Diffstat (limited to 'perl-install')
-rw-r--r--perl-install/network/ethernet.pm10
1 files changed, 8 insertions, 2 deletions
diff --git a/perl-install/network/ethernet.pm b/perl-install/network/ethernet.pm
index bb08738ae..460457df7 100644
--- a/perl-install/network/ethernet.pm
+++ b/perl-install/network/ethernet.pm
@@ -52,7 +52,13 @@ sub get_eth_cards {
my $interface = $_;
my $description;
# 0) get interface's driver through ETHTOOL ioctl or module aliases:
- my $a = c::getNetDriver($interface) || $modules_conf->get_alias($interface);
+ my ($a, $detected_through_ethtool);
+ $a = c::getNetDriver($interface);
+ if ($a) {
+ $detected_through_ethtool = 1;
+ } else {
+ $a = $modules_conf->get_alias($interface);
+ }
# workaround buggy drivers that returns a bogus driver name for the GDRVINFO command of the ETHTOOL ioctl:
my %fixes = (
@@ -79,7 +85,7 @@ sub get_eth_cards {
if (!$description) {
my $drv = readlink("/sys/class/net/$interface/driver");
if ($drv && $drv =~ s!.*/!!) {
- $a = $drv;
+ $a = $drv if $detected_through_ethtool;
my %l;
my %sysfs_fields = (id => "device", subid => "subsystem_device", vendor => "vendor", subvendor => "subsystem_vendor");
$l{$_} = hex(chomp_(cat_("/sys/class/net/$interface/device/" . $sysfs_fields{$_}))) foreach keys %sysfs_fields;