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

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