|
|
18971c |
From 68021e85c982e62dd4082accf024b84da040f450 Mon Sep 17 00:00:00 2001
|
|
|
18971c |
From: Hannes Reinecke <hare@suse.de>
|
|
|
18971c |
Date: Thu, 25 Feb 2016 20:58:13 +0800
|
|
|
18971c |
Subject: [PATCH] 95iscsi: parse output from iscsiadm correctly
|
|
|
18971c |
|
|
|
18971c |
Due to some obsure reason the IFS parameter is not set correctly
|
|
|
18971c |
when evaluating get_ibft_mod(). So change the parsing to not rely
|
|
|
18971c |
on IFS altogether.
|
|
|
18971c |
|
|
|
18971c |
References: bnc#886199
|
|
|
18971c |
|
|
|
18971c |
Signed-off-by: Hannes Reinecke <hare@suse.de>
|
|
|
18971c |
Signed-off-by: Thomas Renninger <trenn@suse.de>
|
|
|
18971c |
---
|
|
|
18971c |
modules.d/95iscsi/module-setup.sh | 13 +++++++------
|
|
|
18971c |
1 file changed, 7 insertions(+), 6 deletions(-)
|
|
|
18971c |
|
|
|
18971c |
diff --git a/modules.d/95iscsi/module-setup.sh b/modules.d/95iscsi/module-setup.sh
|
|
|
18971c |
index 64c9c1d1..b1f5c6cb 100755
|
|
|
18971c |
--- a/modules.d/95iscsi/module-setup.sh
|
|
|
18971c |
+++ b/modules.d/95iscsi/module-setup.sh
|
|
|
18971c |
@@ -31,15 +31,16 @@ check() {
|
|
|
18971c |
|
|
|
18971c |
get_ibft_mod() {
|
|
|
18971c |
local ibft_mac=$1
|
|
|
18971c |
+ local iface_mac iface_mod
|
|
|
18971c |
# Return the iSCSI offload module for a given MAC address
|
|
|
18971c |
- iscsiadm -m iface | while read iface_name iface_desc ; do
|
|
|
18971c |
- IFS=$','
|
|
|
18971c |
- set -- $iface_desc
|
|
|
18971c |
- if [ "$ibft_mac" = "$2" ] ; then
|
|
|
18971c |
- echo $1
|
|
|
18971c |
+ for iface_desc in $(iscsiadm -m iface | cut -f 2 -d ' '); do
|
|
|
18971c |
+ iface_mod=${iface_desc%%,*}
|
|
|
18971c |
+ iface_mac=${iface_desc#*,}
|
|
|
18971c |
+ iface_mac=${iface_mac%%,*}
|
|
|
18971c |
+ if [ "$ibft_mac" = "$iface_mac" ] ; then
|
|
|
18971c |
+ echo $iface_mod
|
|
|
18971c |
return 0
|
|
|
18971c |
fi
|
|
|
18971c |
- unset IFS
|
|
|
18971c |
done
|
|
|
18971c |
}
|
|
|
18971c |
|