From 97230ea3bccd5d6a318b9b94f03e163abba26e03 Mon Sep 17 00:00:00 2001 From: Olivier Blin Date: Fri, 30 Apr 2010 13:31:34 +0000 Subject: installer: configure automatic DHCP on all ethernet interfaces (and not just if there is a unique ethernet interface) --- lib/network/network.pm | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) (limited to 'lib/network/network.pm') diff --git a/lib/network/network.pm b/lib/network/network.pm index 307b5b9..f88939b 100644 --- a/lib/network/network.pm +++ b/lib/network/network.pm @@ -779,20 +779,17 @@ sub easy_dhcp { modules::load_category($modules_conf, list_modules::ethernet_categories()); my @all_dev = sort map { $_->[0] } network::connection::ethernet::get_eth_cards($modules_conf); - #- only for a single ethernet network card my @ether_dev = grep { /^eth[0-9]+$/ && `LC_ALL= LANG= $::prefix/sbin/ip -o link show $_ 2>/dev/null` =~ m|\slink/ether\s| } @all_dev; - @ether_dev == 1 or return; - - my $dhcp_intf = $ether_dev[0]; - log::explanations("easy_dhcp: found $dhcp_intf"); - - $net->{ifcfg}{$dhcp_intf} ||= {}; - put_in_hash($net->{ifcfg}{$dhcp_intf}, { + foreach my $dhcp_intf (@ether_dev) { + log::explanations("easy_dhcp: found $dhcp_intf"); + $net->{ifcfg}{$dhcp_intf} ||= {}; + put_in_hash($net->{ifcfg}{$dhcp_intf}, { DEVICE => $dhcp_intf, BOOTPROTO => 'dhcp', NETMASK => '255.255.255.0', ONBOOT => 'yes' - }); + }); + } 1; } -- cgit v1.2.1