From d4a9ce9799d18750b85221a3357f48a13547e181 Mon Sep 17 00:00:00 2001 From: Olivier Blin Date: Tue, 17 Aug 2004 10:49:25 +0000 Subject: (write_interface_conf) use unspec descriptor in iftab if link isn't ether --- perl-install/network/network.pm | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'perl-install/network/network.pm') diff --git a/perl-install/network/network.pm b/perl-install/network/network.pm index 325b8f242..a5e9bd20b 100644 --- a/perl-install/network/network.pm +++ b/perl-install/network/network.pm @@ -141,11 +141,12 @@ sub write_resolv_conf { sub write_interface_conf { my ($file, $intf, $_netc, $_prefix) = @_; - my ($mac_address) = `LC_ALL= LANG= $::prefix/sbin/ip -o link show $intf->{DEVICE} 2>/dev/null` =~ m|.*link/ether\s([0-9a-z:]+)\s|; + my ($link_type, $mac_address) = `LC_ALL= LANG= $::prefix/sbin/ip -o link show $intf->{DEVICE} 2>/dev/null` =~ m|.*link/(\S+)\s([0-9a-z:]+)\s|; $intf->{HWADDR} &&= $mac_address; #- set HWADDR to MAC address if required #- write interface MAC address in iftab (if any) - substInFile { s/^$intf->{DEVICE}\s+.*\n//; $_ .= qq($intf->{DEVICE}\tmac $mac_address\n) if eof } "$::prefix/etc/iftab" if $mac_address; + my $descriptor = $link_type eq 'ether' ? 'mac' : 'unspec'; + substInFile { s/^$intf->{DEVICE}\s+.*\n//; $_ .= qq($intf->{DEVICE}\t$descriptor $mac_address\n) if eof } "$::prefix/etc/iftab" if $mac_address; my @ip = split '\.', $intf->{IPADDR}; my @mask = split '\.', $intf->{NETMASK}; -- cgit v1.2.1