Blame 0018-ifcfg-fix-output-for-ipv6-static-addressing.patch

Harald Hoyer d1bf89
From 30430fbe3096da363a2ef6b8c791e701643e15aa Mon Sep 17 00:00:00 2001
Harald Hoyer d1bf89
From: Will Woods <wwoods@redhat.com>
Harald Hoyer d1bf89
Date: Mon, 11 Jun 2012 13:46:22 -0400
Harald Hoyer d1bf89
Subject: [PATCH] ifcfg: fix output for ipv6 static addressing
Harald Hoyer d1bf89
Harald Hoyer d1bf89
IPV6 configuration is pretty different than IPV4; write out the correct
Harald Hoyer d1bf89
set of values to make static IPV6 addressing work.
Harald Hoyer d1bf89
---
Harald Hoyer d1bf89
 modules.d/45ifcfg/write-ifcfg.sh |   23 ++++++++++++++++-------
Harald Hoyer d1bf89
 1 file changed, 16 insertions(+), 7 deletions(-)
Harald Hoyer d1bf89
Harald Hoyer d1bf89
diff --git a/modules.d/45ifcfg/write-ifcfg.sh b/modules.d/45ifcfg/write-ifcfg.sh
Harald Hoyer d1bf89
index 202a16a..b62170d 100755
Harald Hoyer d1bf89
--- a/modules.d/45ifcfg/write-ifcfg.sh
Harald Hoyer d1bf89
+++ b/modules.d/45ifcfg/write-ifcfg.sh
Harald Hoyer d1bf89
@@ -109,16 +109,25 @@ for netif in $IFACES ; do
Harald Hoyer d1bf89
             echo "BOOTPROTO=dhcp"
Harald Hoyer d1bf89
             cp /tmp/net.$netif.lease /tmp/ifcfg-leases/dhclient-$uuid-$netif.lease
Harald Hoyer d1bf89
         else
Harald Hoyer d1bf89
-            echo "BOOTPROTO=none"
Harald Hoyer d1bf89
-        # If we've booted with static ip= lines, the override file is there
Harald Hoyer d1bf89
+            # If we've booted with static ip= lines, the override file is there
Harald Hoyer d1bf89
             [ -e /tmp/net.$netif.override ] && . /tmp/net.$netif.override
Harald Hoyer d1bf89
-            echo "IPADDR=$ip"
Harald Hoyer d1bf89
-            if strstr "$mask" "."; then
Harald Hoyer d1bf89
-                echo "NETMASK=$mask"
Harald Hoyer d1bf89
+            if strstr "$ip" '*:*:*'; then
Harald Hoyer d1bf89
+                echo "IPV6_AUTOCONF=no"
Harald Hoyer d1bf89
+                echo "IPV6ADDR=$ip/$mask"
Harald Hoyer d1bf89
             else
Harald Hoyer d1bf89
-                echo "PREFIX=$mask"
Harald Hoyer d1bf89
+                echo "BOOTPROTO=none"
Harald Hoyer d1bf89
+                echo "IPADDR=$ip"
Harald Hoyer d1bf89
+                if strstr "$mask" "."; then
Harald Hoyer d1bf89
+                    echo "NETMASK=$mask"
Harald Hoyer d1bf89
+                else
Harald Hoyer d1bf89
+                    echo "PREFIX=$mask"
Harald Hoyer d1bf89
+                fi
Harald Hoyer d1bf89
+            fi
Harald Hoyer d1bf89
+            if strstr "$gw" '*:*:*'; then
Harald Hoyer d1bf89
+                echo "IPV6_DEFAULTGW=$gw"
Harald Hoyer d1bf89
+            elif [ -n "$gw" ]; then
Harald Hoyer d1bf89
+                echo "GATEWAY=$gw"
Harald Hoyer d1bf89
             fi
Harald Hoyer d1bf89
-            [ -n "$gw" ] && echo "GATEWAY=$gw"
Harald Hoyer d1bf89
         fi
Harald Hoyer d1bf89
     } > /tmp/ifcfg/ifcfg-$netif
Harald Hoyer d1bf89