From: Will Woods Date: Mon, 11 Jun 2012 17:46:22 +0000 (-0400) Subject: ifcfg: fix output for ipv6 static addressing X-Git-Tag: 020~98 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=30430fbe3096da363a2ef6b8c791e701643e15aa;p=platform%2Fupstream%2Fdracut.git ifcfg: fix output for ipv6 static addressing IPV6 configuration is pretty different than IPV4; write out the correct set of values to make static IPV6 addressing work. --- diff --git a/modules.d/45ifcfg/write-ifcfg.sh b/modules.d/45ifcfg/write-ifcfg.sh index 202a16a..b62170d 100755 --- a/modules.d/45ifcfg/write-ifcfg.sh +++ b/modules.d/45ifcfg/write-ifcfg.sh @@ -109,16 +109,25 @@ for netif in $IFACES ; do echo "BOOTPROTO=dhcp" cp /tmp/net.$netif.lease /tmp/ifcfg-leases/dhclient-$uuid-$netif.lease else - echo "BOOTPROTO=none" - # If we've booted with static ip= lines, the override file is there + # If we've booted with static ip= lines, the override file is there [ -e /tmp/net.$netif.override ] && . /tmp/net.$netif.override - echo "IPADDR=$ip" - if strstr "$mask" "."; then - echo "NETMASK=$mask" + if strstr "$ip" '*:*:*'; then + echo "IPV6_AUTOCONF=no" + echo "IPV6ADDR=$ip/$mask" else - echo "PREFIX=$mask" + echo "BOOTPROTO=none" + echo "IPADDR=$ip" + if strstr "$mask" "."; then + echo "NETMASK=$mask" + else + echo "PREFIX=$mask" + fi + fi + if strstr "$gw" '*:*:*'; then + echo "IPV6_DEFAULTGW=$gw" + elif [ -n "$gw" ]; then + echo "GATEWAY=$gw" fi - [ -n "$gw" ] && echo "GATEWAY=$gw" fi } > /tmp/ifcfg/ifcfg-$netif