From d28fe228e9616d4b1bc8a6a5bef53a423a5151a1 Mon Sep 17 00:00:00 2001 From: Olivier Blin Date: Wed, 8 Sep 2004 07:21:54 +0000 Subject: remove update_eth_card_iftab(), add update_iftab() --- perl-install/network/ethernet.pm | 22 ++++++++++------------ 1 file changed, 10 insertions(+), 12 deletions(-) diff --git a/perl-install/network/ethernet.pm b/perl-install/network/ethernet.pm index 2659950ef..723daa196 100644 --- a/perl-install/network/ethernet.pm +++ b/perl-install/network/ethernet.pm @@ -85,9 +85,6 @@ sub get_eth_cards_names { #- fix modules aliases $modules_conf->remove_alias($card->[1]); $modules_conf->set_alias($card->[0], $card->[1]); - - #- update iftab - update_eth_card_iftab($card->[0]); } { map { $_->[0] => join(': ', $_->[0], $_->[2]) } @all_cards }; @@ -99,15 +96,16 @@ sub get_eth_card_mac_address { `LC_ALL= LANG= $::prefix/sbin/ip -o link show $intf 2>/dev/null` =~ m|.*link/(\S+)\s([0-9a-z:]+)\s|; } -#- write interface MAC address (if any) in iftab -sub update_eth_card_iftab { - my ($intf) = @_; - my ($link_type, $mac_address) = get_eth_card_mac_address($intf) or next; - my $descriptor = ${{ ether => 'mac', ieee1394 => 'mac_ieee1394' }}{$link_type} or next; - substInFile { - s/^$intf\s+.*\n//; - $_ .= qq($intf\t$descriptor $mac_address\n) if eof - } "$::prefix/etc/iftab"; +#- write interfaces MAC address in iftab +sub update_iftab() { + foreach my $intf (detect_devices::getNet()) { + my ($link_type, $mac_address) = get_eth_card_mac_address($intf) or next; + my $descriptor = ${{ ether => 'mac', ieee1394 => 'mac_ieee1394' }}{$link_type} or next; + substInFile { + s/^$intf\s+.*\n//; + $_ .= qq($intf\t$descriptor $mac_address\n) if eof + } "$::prefix/etc/iftab"; + } } # automatic net aliases configuration -- cgit v1.2.1