From: Will Woods Date: Mon, 11 Jun 2012 17:46:21 +0000 (-0400) Subject: fix ifup for static ipv6 X-Git-Tag: 020~99 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=50b08e7b85085169459dd971b711f712744598ef;p=thirdparty%2Fdracut.git fix ifup for static ipv6 "brd +" is not valid for ipv6. This causes the 'ip addr add' command to fail with the message "Broadcast can be set only for IPv4 addresses". So: don't use "brd +" for ipv6. --- diff --git a/modules.d/40network/ifup.sh b/modules.d/40network/ifup.sh index 35ae3c60b..ae434a8af 100755 --- a/modules.d/40network/ifup.sh +++ b/modules.d/40network/ifup.sh @@ -105,10 +105,13 @@ do_static() { wait_for_if_up $netif [ -n "$macaddr" ] && ip link set address $macaddr [ -n "$mtu" ] && ip link set mtu $mtu - # do not flush addr for ipv6 - strstr $ip '*:*:*' || \ + if strstr $ip '*:*:*'; then + # note no ip addr flush for ipv6 + ip addr add $ip/$mask dev $netif + else ip addr flush dev $netif - ip addr add $ip/$mask brd + dev $netif + ip addr add $ip/$mask brd + dev $netif + fi [ -n "$gw" ] && echo ip route add default via $gw dev $netif > /tmp/net.$netif.gw [ -n "$hostname" ] && echo "echo $hostname > /proc/sys/kernel/hostname" > /tmp/net.$netif.hostname