File s390-tools-sles11sp2-znetconf-ip-vswitch.patch of Package s390-tools

Description: znetconf: layer autodetection not working for IP VSWITCH
Symptom:     Layer 3 for a NIC is not detected automatically for vNICs being
             coupled to IP VSWITCHes.
             Users adding such a NIC via znetconf observe that the device
             gets configured in layer 2 mode and fails to become online.
Problem:     Parsing logic only detected NONROUTER and PRIROUTER layer 3
             VSWITCHES and not plain IP VSWITCH configurations.
Solution:    IP is interpreted as layer 3 indicator as well.
Problem-ID:  79466

---
 zconf/znetconf |   15 ++++++++++++---
 1 file changed, 12 insertions(+), 3 deletions(-)

--- a/zconf/znetconf
+++ b/zconf/znetconf
@@ -115,8 +115,16 @@ function print_warning()
 
 function check_vm_env()
 {
-	if modprobe vmcp 2> /dev/null ; then
-		IS_VM_ENV=1
+	if cat /proc/sysinfo | grep VM00 &> /dev/null ; then
+		if vmcp q cplevel &> /dev/null ; then
+			IS_VM_ENV=1
+		else
+			if modprobe vmcp 2> /dev/null ; then
+				IS_VM_ENV=1
+			else
+				IS_VM_ENV=0
+			fi
+		fi
 	else
 		IS_VM_ENV=0
 	fi
@@ -200,7 +208,8 @@ function lookup_vswitch_layer()
 				then
 					LAYER2=1
 				elif [ "$FIELD3" == "NONROUTER" ] ||
-					[ "$FIELD3" == "PRIROUTER" ]
+					[ "$FIELD3" == "PRIROUTER" ] ||
+					[ "$FIELD3" == "IP" ]
 				then
 					LAYER2=0
 				fi
openSUSE Build Service is sponsored by