summaryrefslogtreecommitdiffstats
path: root/perl-install/network/ethernet.pm
diff options
context:
space:
mode:
Diffstat (limited to 'perl-install/network/ethernet.pm')
-rw-r--r--perl-install/network/ethernet.pm25
1 files changed, 14 insertions, 11 deletions
diff --git a/perl-install/network/ethernet.pm b/perl-install/network/ethernet.pm
index 8c3bb5b56..bcda4a64b 100644
--- a/perl-install/network/ethernet.pm
+++ b/perl-install/network/ethernet.pm
@@ -115,16 +115,11 @@ sub conf_network_card_backend {
my $saved_driver;
return map {
my $interface = $_;
- my $interface_state = `LC_ALL=C LANG=C LANGUAGE=C LC_MESSAGES=C $::prefix/sbin/ifconfig "$interface"`;
- my $a = modules::get_alias($interface);
- my $b;
- foreach (@devs) {
- $_->{device} eq $interface and $b = $_->{driver};
- }
- $a ||= $b;
- $a and $saved_driver = $a;
- if_($::isInstall || $interface_state =~ /inet addr|Bcast|Mask|Interrupt|Base address/ && $a,
- [$interface, $saved_driver]);
+ my $a = c::getNetDriver($interface) || modules::get_alias($interface);
+ my $b = find { $_->{device} eq $interface } @devs;
+ $a ||= $b->{driver};
+ $a and $saved_driver = $a; # handle multiple cards managed by the same driver
+ [ $interface, $saved_driver ]
} @all_cards;
}
$o_interface =~ /eth[0-9]+/ or die("the interface is not an ethx");
@@ -153,7 +148,7 @@ sub configureNetwork {
my @l = map { $_->[0] } @all_cards;
foreach (@all_cards) {
- modules::remove_alias($_->[0]);
+ modules::remove_alias($_->[1]);
modules::add_alias($_->[0], $_->[1]);
}
@@ -196,4 +191,12 @@ want to use the default host name."),
1;
}
+# automatic net aliases configuration
+sub configure_eth_aliases() {
+ foreach (detect_devices::getNet()) {
+ my $driver = c::getNetDriver($_) or next;
+ modules::add_alias($_, $driver);
+ }
+}
+
1;