|
Harald Hoyer |
460d2c |
From 6dbae7e77238dd44bedb0ca2478f985f451c05bf Mon Sep 17 00:00:00 2001
|
|
Harald Hoyer |
460d2c |
From: Martin Wilck <mwilck@suse.de>
|
|
Harald Hoyer |
460d2c |
Date: Fri, 10 Jul 2020 18:09:05 +0200
|
|
Harald Hoyer |
460d2c |
Subject: [PATCH] 95iscsi: use ip_params_for_remote_addr()
|
|
Harald Hoyer |
460d2c |
|
|
Harald Hoyer |
460d2c |
Use the new helper function.
|
|
Harald Hoyer |
460d2c |
---
|
|
Harald Hoyer |
460d2c |
modules.d/95iscsi/module-setup.sh | 22 +---------------------
|
|
Harald Hoyer |
460d2c |
1 file changed, 1 insertion(+), 21 deletions(-)
|
|
Harald Hoyer |
460d2c |
|
|
Harald Hoyer |
460d2c |
diff --git a/modules.d/95iscsi/module-setup.sh b/modules.d/95iscsi/module-setup.sh
|
|
Harald Hoyer |
460d2c |
index 8b6300d5..dfacd797 100755
|
|
Harald Hoyer |
460d2c |
--- a/modules.d/95iscsi/module-setup.sh
|
|
Harald Hoyer |
460d2c |
+++ b/modules.d/95iscsi/module-setup.sh
|
|
Harald Hoyer |
460d2c |
@@ -120,27 +120,7 @@ install_iscsiroot() {
|
|
Harald Hoyer |
460d2c |
done
|
|
Harald Hoyer |
460d2c |
|
|
Harald Hoyer |
460d2c |
[ -z "$iscsi_address" ] && return
|
|
Harald Hoyer |
460d2c |
- local_address=$(ip -o route get to $iscsi_address | sed -n 's/.*src \([0-9a-f.:]*\).*/\1/p')
|
|
Harald Hoyer |
460d2c |
- ifname=$(ip -o route get to $iscsi_address | sed -n 's/.*dev \([^ ]*\).*/\1/p')
|
|
Harald Hoyer |
460d2c |
-
|
|
Harald Hoyer |
460d2c |
- # follow ifcfg settings for boot protocol
|
|
Harald Hoyer |
460d2c |
- for _path in \
|
|
Harald Hoyer |
460d2c |
- "/etc/sysconfig/network-scripts/ifcfg-$ifname" \
|
|
Harald Hoyer |
460d2c |
- "/etc/sysconfig/network/ifcfg-$ifname" \
|
|
Harald Hoyer |
460d2c |
- ; do
|
|
Harald Hoyer |
460d2c |
- [ -f "$_path" ] && bootproto=$(sed -n "s/BOOTPROTO='\?\([[:alpha:]]*6\?\)4\?/\1/p" "$_path")
|
|
Harald Hoyer |
460d2c |
- done
|
|
Harald Hoyer |
460d2c |
-
|
|
Harald Hoyer |
460d2c |
- if [ $bootproto ]; then
|
|
Harald Hoyer |
460d2c |
- printf 'ip=%s:%s ' ${ifname} ${bootproto}
|
|
Harald Hoyer |
460d2c |
- else
|
|
Harald Hoyer |
460d2c |
- printf 'ip=%s:static ' ${ifname}
|
|
Harald Hoyer |
460d2c |
- fi
|
|
Harald Hoyer |
460d2c |
-
|
|
Harald Hoyer |
460d2c |
- if [ -e /sys/class/net/$ifname/address ] ; then
|
|
Harald Hoyer |
460d2c |
- ifmac=$(cat /sys/class/net/$ifname/address)
|
|
Harald Hoyer |
460d2c |
- printf 'ifname=%s:%s ' ${ifname} ${ifmac}
|
|
Harald Hoyer |
460d2c |
- fi
|
|
Harald Hoyer |
460d2c |
+ ip_params_for_remote_addr "$iscsi_address"
|
|
Harald Hoyer |
460d2c |
|
|
Harald Hoyer |
460d2c |
if [ -n "$iscsi_address" -a -n "$iscsi_targetname" ] ; then
|
|
Harald Hoyer |
460d2c |
if [ -n "$iscsi_port" -a "$iscsi_port" -eq 3260 ] ; then
|
|
Harald Hoyer |
460d2c |
|