Blame SOURCES/0134-ifcfg-write-ifcfg.sh-do-not-bind-s390-to-MAC-if-SUBC.patch

712866
From ea6bc75ccbb626c62062bdf2d3ca2a90dbb9467d Mon Sep 17 00:00:00 2001
712866
From: Harald Hoyer <harald@redhat.com>
712866
Date: Tue, 25 Feb 2014 13:05:11 +0100
712866
Subject: [PATCH] ifcfg/write-ifcfg.sh: do not bind s390 to MAC if SUBCHANNELS
712866
 set
712866
712866
If SUBCHANNELS are set, do not specify HWADDR, because the SUBCHANNELS
712866
are the identifier for the interface.
712866
712866
https://bugzilla.redhat.com/show_bug.cgi?id=1056438
712866
---
712866
 modules.d/45ifcfg/write-ifcfg.sh | 13 ++++++-------
712866
 1 file changed, 6 insertions(+), 7 deletions(-)
712866
712866
diff --git a/modules.d/45ifcfg/write-ifcfg.sh b/modules.d/45ifcfg/write-ifcfg.sh
5c6c2a
index dcb2aefa..d9e9f3af 100755
712866
--- a/modules.d/45ifcfg/write-ifcfg.sh
712866
+++ b/modules.d/45ifcfg/write-ifcfg.sh
712866
@@ -55,9 +55,9 @@ print_s390() {
712866
 
712866
     SUBCHANNELS=${SUBCHANNELS%,}
712866
     echo "SUBCHANNELS=\"${SUBCHANNELS}\""
712866
-    CONFIG_LINE=$(get_config_line_by_subchannel $SUBCHANNELS)
712866
 
712866
-    [ $? -ne 0 -o -z "$CONFIG_LINE" ] && return
712866
+    CONFIG_LINE=$(get_config_line_by_subchannel $SUBCHANNELS)
712866
+    [ $? -ne 0 -o -z "$CONFIG_LINE" ] && return 0
712866
 
712866
     OLD_IFS=$IFS
712866
     IFS=","
712866
@@ -77,6 +77,7 @@ print_s390() {
712866
     OPTIONS=${OPTIONS## }
712866
     echo "NETTYPE=\"${NETTYPE}\""
712866
     echo "OPTIONS=\"${OPTIONS}\""
712866
+    return 0
712866
 }
712866
 
712866
 for netup in /tmp/net.*.did-setup ; do
712866
@@ -159,12 +160,10 @@ for netup in /tmp/net.*.did-setup ; do
712866
     if [ -z "$bridge" ] && [ -z "$bond" ] && [ -z "$vlan" ]; then
712866
         # standard interface
712866
         {
712866
-            if [ -n "$macaddr" ]; then
712866
-                echo "MACADDR=\"$macaddr\""
712866
-            else
712866
-                echo "HWADDR=\"$(cat /sys/class/net/$netif/address)\""
712866
+            [ -n "$macaddr" ] && echo "MACADDR=\"$macaddr\""
712866
+            if ! print_s390 $netif; then
712866
+                [ -n "$macaddr" ] || echo "HWADDR=\"$(cat /sys/class/net/$netif/address)\""
712866
             fi
712866
-            print_s390 $netif
712866
             echo "TYPE=Ethernet"
712866
             echo "NAME=\"$netif\""
712866
             [ -n "$mtu" ] && echo "MTU=\"$mtu\""