From 02f6c1f6cf632a8badfb56e147b9b282bfbc5499 Mon Sep 17 00:00:00 2001 From: Olivier Blin Date: Thu, 27 Oct 2005 16:43:46 +0000 Subject: use standard 'mac' modifier in iftab for IEEE1394, EUI64 and IRDA --- perl-install/network/ethernet.pm | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'perl-install/network/ethernet.pm') diff --git a/perl-install/network/ethernet.pm b/perl-install/network/ethernet.pm index 572a33ae8..00f0b8e26 100644 --- a/perl-install/network/ethernet.pm +++ b/perl-install/network/ethernet.pm @@ -111,7 +111,7 @@ sub get_eth_cards_names { #- returns (link_type, mac_address) sub get_eth_card_mac_address { my ($intf) = @_; - #- don't look for 6 bytes addresses only because of firewire + #- don't look for 6 bytes addresses only because of various non-standard MAC addresses `$::prefix/sbin/ip -o link show $intf 2>/dev/null` =~ m|.*link/(\S+)\s((?:[0-9a-f]{2}:?)+)\s|; } @@ -122,11 +122,12 @@ sub update_iftab() { my ($link_type, $mac_address) = get_eth_card_mac_address($intf) or next; #- do not write zeroed MAC addresses in iftab, it confuses ifrename $mac_address =~ /^[0:]+$/ and next; - my $descriptor = ${{ ether => 'mac', ieee1394 => 'mac_ieee1394' }}{$link_type} or next; + # ifrename supports alsa IEEE1394, EUI64 and IRDA + member($link, 'ether', 'ieee1394', 'irda', '[27]') or next; substInFile { s/^$intf\s+.*\n//; s/^.*\s+$mac_address\n//; - $_ .= qq($intf\t$descriptor $mac_address\n) if eof; + $_ .= qq($intf mac $mac_address\n) if eof; } "$::prefix/etc/iftab"; } } -- cgit v1.2.1