summaryrefslogtreecommitdiffstats
path: root/perl-install/network/network.pm
diff options
context:
space:
mode:
Diffstat (limited to 'perl-install/network/network.pm')
-rw-r--r--perl-install/network/network.pm10
1 files changed, 6 insertions, 4 deletions
diff --git a/perl-install/network/network.pm b/perl-install/network/network.pm
index a5e9bd20b..b4d06d01e 100644
--- a/perl-install/network/network.pm
+++ b/perl-install/network/network.pm
@@ -367,12 +367,14 @@ sub easy_dhcp {
modules::load_category($modules_conf, 'network/main|gigabit|pcmcia|usb');
my @all_cards = network::ethernet::get_eth_cards($modules_conf);
- #- only for a single network card
- (any { $_->[0] eq 'eth0' } @all_cards) && (every { $_->[0] ne 'eth1' } @all_cards) or return;
+ #- only for a single ethernet network card
+ my @ether_cards = grep { `LC_ALL= LANG= $::prefix/sbin/ip -o link show $_->[0] 2>/dev/null` =~ m|\slink/ether\s| } @all_cards;
+ @ether_cards == 1 or return;
- log::explanations("easy_dhcp: found eth0");
+ my $dhcp_intf = $ether_cards[0][0];
+ log::explanations("easy_dhcp: found $dhcp_intf");
- network::ethernet::conf_network_card_backend($netc, $intf, 'dhcp', 'eth0');
+ network::ethernet::conf_network_card_backend($netc, $intf, 'dhcp', $dhcp_intf);
put_in_hash($netc, {
NETWORKING => "yes",