summaryrefslogtreecommitdiffstats
path: root/perl-install
diff options
context:
space:
mode:
authorOlivier Blin <oblin@mandriva.org>2004-08-17 10:49:25 +0000
committerOlivier Blin <oblin@mandriva.org>2004-08-17 10:49:25 +0000
commitd4a9ce9799d18750b85221a3357f48a13547e181 (patch)
tree05c913fc6bf7efcab7df79d5b2a21398fe198074 /perl-install
parent149bb3119634f9f9ffa5910527e7fae1ca4f1320 (diff)
downloaddrakx-d4a9ce9799d18750b85221a3357f48a13547e181.tar
drakx-d4a9ce9799d18750b85221a3357f48a13547e181.tar.gz
drakx-d4a9ce9799d18750b85221a3357f48a13547e181.tar.bz2
drakx-d4a9ce9799d18750b85221a3357f48a13547e181.tar.xz
drakx-d4a9ce9799d18750b85221a3357f48a13547e181.zip
(write_interface_conf) use unspec descriptor in iftab if link isn't ether
Diffstat (limited to 'perl-install')
-rw-r--r--perl-install/network/network.pm5
1 files changed, 3 insertions, 2 deletions
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};