Blame SOURCES/0233-network-add-support-for-comma-separated-autoconf-opt.patch

712866
From 368f08cb7efca9738292859e179da269597412e4 Mon Sep 17 00:00:00 2001
712866
From: Harald Hoyer <harald@redhat.com>
712866
Date: Wed, 14 Jan 2015 11:28:16 +0100
712866
Subject: [PATCH] network: add support for comma separated autoconf options
712866
712866
ip=eth0:auto6,dhcp
712866
712866
might work now
712866
---
712866
 modules.d/40network/ifup.sh          | 24 ++++++++++++-----------
712866
 modules.d/40network/parse-ip-opts.sh | 38 +++++++++++++++++++-----------------
712866
 2 files changed, 33 insertions(+), 29 deletions(-)
712866
712866
diff --git a/modules.d/40network/ifup.sh b/modules.d/40network/ifup.sh
5c6c2a
index 67b1d9f8..8749c4c2 100755
712866
--- a/modules.d/40network/ifup.sh
712866
+++ b/modules.d/40network/ifup.sh
712866
@@ -326,17 +326,19 @@ for p in $(getargs ip=); do
712866
         eval '[ "$'$i'" ] && echo '$i'="$'$i'"'
712866
     done > /tmp/net.$netif.override
712866
 
712866
-    case $autoconf in
712866
-        dhcp|on|any)
712866
-            do_dhcp -4 ;;
712866
-        dhcp6)
712866
-            load_ipv6
712866
-            do_dhcp -6 ;;
712866
-        auto6)
712866
-            do_ipv6auto ;;
712866
-        *)
712866
-            do_static ;;
712866
-    esac
712866
+    for autoopt in $(str_replace "$autoconf" "," " "); do
712866
+        case $autoopt in
712866
+            dhcp|on|any)
712866
+                do_dhcp -4 ;;
712866
+            dhcp6)
712866
+                load_ipv6
712866
+                do_dhcp -6 ;;
712866
+            auto6)
712866
+                do_ipv6auto ;;
712866
+            *)
712866
+                do_static ;;
712866
+        esac
712866
+    done
712866
 
712866
     > /tmp/net.${netif}.up
712866
 
712866
diff --git a/modules.d/40network/parse-ip-opts.sh b/modules.d/40network/parse-ip-opts.sh
5c6c2a
index b029d007..5b96e069 100755
712866
--- a/modules.d/40network/parse-ip-opts.sh
712866
+++ b/modules.d/40network/parse-ip-opts.sh
712866
@@ -66,24 +66,26 @@ for p in $(getargs ip=); do
712866
     fi
712866
 
712866
     # Error checking for autoconf in combination with other values
712866
-    case $autoconf in
712866
-        error) die "Error parsing option 'ip=$p'";;
712866
-        bootp|rarp|both) die "Sorry, ip=$autoconf is currenty unsupported";;
712866
-        none|off)
712866
-            [ -z "$ip" ] && \
712866
-            die "For argument 'ip=$p'\nValue '$autoconf' without static configuration does not make sense"
712866
-            [ -z "$mask" ] && \
712866
-                die "Sorry, automatic calculation of netmask is not yet supported"
712866
-            ;;
712866
-        auto6);;
712866
-        dhcp|dhcp6|on|any) \
712866
-            [ -n "$NEEDBOOTDEV" ] && [ -z "$dev" ] && \
712866
-            die "Sorry, 'ip=$p' does not make sense for multiple interface configurations"
712866
-            [ -n "$ip" ] && \
712866
-                die "For argument 'ip=$p'\nSorry, setting client-ip does not make sense for '$autoconf'"
712866
-            ;;
712866
-        *) die "For argument 'ip=$p'\nSorry, unknown value '$autoconf'";;
712866
-    esac
712866
+    for autoopt in $(str_replace "$autoconf" "," " "); do
712866
+        case $autoopt in
712866
+            error) die "Error parsing option 'ip=$p'";;
712866
+            bootp|rarp|both) die "Sorry, ip=$autoopt is currenty unsupported";;
712866
+            none|off)
712866
+                [ -z "$ip" ] && \
712866
+                    die "For argument 'ip=$p'\nValue '$autoopt' without static configuration does not make sense"
712866
+                [ -z "$mask" ] && \
712866
+                    die "Sorry, automatic calculation of netmask is not yet supported"
712866
+                ;;
712866
+            auto6);;
712866
+            dhcp|dhcp6|on|any) \
712866
+                [ -n "$NEEDBOOTDEV" ] && [ -z "$dev" ] && \
712866
+                    die "Sorry, 'ip=$p' does not make sense for multiple interface configurations"
712866
+                [ -n "$ip" ] && \
712866
+                    die "For argument 'ip=$p'\nSorry, setting client-ip does not make sense for '$autoopt'"
712866
+                ;;
712866
+            *) die "For argument 'ip=$p'\nSorry, unknown value '$autoopt'";;
712866
+        esac
712866
+    done
712866
 
712866
     if [ -n "$dev" ] ; then
712866
         # We don't like duplicate device configs