Due to the different format between ipv4 and ipv6 protocol, quote the
ipv6 address with bracket "[]" to make dracut notify.
Signed-off-by: Minfei Huang <mhuang(a)redhat.com>
Acked-by: Dave Young <dyoung(a)redhat.com>
---
dracut-module-setup.sh | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/dracut-module-setup.sh b/dracut-module-setup.sh
index f47e57e..3c9dd9f 100755
--- a/dracut-module-setup.sh
+++ b/dracut-module-setup.sh
@@ -529,10 +529,12 @@ kdump_setup_iscsi_device() {
kdump_setup_netdev $netdev $srcaddr $tgt_ipaddr
# prepare netroot= command line
- # FIXME: IPV6 addresses require explicit [] around $tgt_ipaddr
# FIXME: Do we need to parse and set other parameters like protocol, port
# iscsi_iface_name, netdev_name, LUN etc.
+ if is_ipv6_address $tgt_ipaddr; then
+ tgt_ipaddr="[$tgt_ipaddr]"
+ fi
netroot_str="netroot=iscsi:${userpwd_str}${userpwd_in_str}@$tgt_ipaddr::::$tgt_name"
[[ -f $netroot_conf ]] || touch $netroot_conf
--
2.1.0