From ab16a4bc28eaa33339b6828d2eda6871517840f4 Mon Sep 17 00:00:00 2001 From: Thierry Vignaud Date: Wed, 9 Mar 2005 12:06:09 +0000 Subject: (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) --- perl-install/network/ethernet.pm | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'perl-install/network/ethernet.pm') 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; -- cgit v1.2.1