From: Harald Hoyer Date: Mon, 26 Nov 2012 12:49:38 +0000 (+0100) Subject: network: fixed MAC address assignment X-Git-Tag: 025~44 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=7990578443402fc88024ab0fdabf9224e63ef705;p=thirdparty%2Fdracut.git network: fixed MAC address assignment --- diff --git a/modules.d/40network/ifup.sh b/modules.d/40network/ifup.sh index db233de7b..70bc1612d 100755 --- a/modules.d/40network/ifup.sh +++ b/modules.d/40network/ifup.sh @@ -96,10 +96,10 @@ do_ipv6auto() { do_static() { strstr $ip '*:*:*' && load_ipv6 - ip link set $netif up + ip link set dev $netif up wait_for_if_up $netif - [ -n "$macaddr" ] && ip link set address $macaddr - [ -n "$mtu" ] && ip link set mtu $mtu + [ -n "$macaddr" ] && ip link set address $macaddr dev $netif + [ -n "$mtu" ] && ip link set mtu $mtu dev $netif if strstr $ip '*:*:*'; then # note no ip addr flush for ipv6 ip addr add $ip/$mask dev $netif diff --git a/modules.d/40network/net-lib.sh b/modules.d/40network/net-lib.sh index 10b630e57..9b2f29183 100644 --- a/modules.d/40network/net-lib.sh +++ b/modules.d/40network/net-lib.sh @@ -1,4 +1,6 @@ #!/bin/sh +# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*- +# ex: ts=8 sw=4 sts=4 et filetype=sh get_ip() { local iface="$1" ip="" @@ -272,7 +274,12 @@ ip_to_var() { 2) dev=$1; autoconf=$2 ;; 3) dev=$1; autoconf=$2; mtu=$3 ;; 4) dev=$1; autoconf=$2; mtu=$3; macaddr=$4 ;; - *) ip=$1; srv=$2; gw=$3; mask=$4; hostname=$5; dev=$6; autoconf=$7; mtu=$8; macaddr=$9 ;; + *) ip=$1; srv=$2; gw=$3; mask=$4; + hostname=$5; dev=$6; autoconf=$7; mtu=$8; + if [ -n "${9}" -a -n "${10}" -a -n "${11}" -a -n "${12}" -a -n "${13}" -a -n "${14}" ]; then + macaddr="${9}:${10}:${11}:${12}:${13}:${14}" + fi + ;; esac # anaconda-style argument cluster if strstr "$autoconf" "*.*.*.*"; then