On 02/17/15 at 06:23pm, Baoquan He wrote:
On 02/15/15 at 03:45pm, Minfei Huang wrote:
> Now the dracut does not have enough info to setup the ipv6 to connect
> the iscsi target in the 2nd kernel, if the iscsi connecting is ipv6
> protocal.
>
> For this patch, we will parse the iscsi connecting, pass the config to
> the dracut to setup the ipv6 in the 2nd kernel.
>
> Signed-off-by: Minfei Huang <mhuang(a)redhat.com>
> ---
> dracut-module-setup.sh | 25 ++++++++++++++++++++-----
> 1 file changed, 20 insertions(+), 5 deletions(-)
What's your suggestion or plan on testing of ipv6 iscsi? Just think that
once ipv6 is merged and declare to support, customers will report bugs
on kinds of features with ipv6.
Hi, Bao!
The way which supports the iscsi with ipv6 is same as ipv4. So I think
the general testcase is fine. Meanwhile we can fix the bug in the
future, if we meet.
Thanks
Minfei
>
> diff --git a/dracut-module-setup.sh b/dracut-module-setup.sh
> index 1a1f03e..6ed1034 100755
> --- a/dracut-module-setup.sh
> +++ b/dracut-module-setup.sh
> @@ -480,6 +480,7 @@ kdump_get_iscsi_initiator() {
> kdump_setup_iscsi_device() {
> local path=$1
> local tgt_name; local tgt_ipaddr;
> + local _srcaddr _prefix _netdev
> local username; local password; local userpwd_str;
> local username_in; local password_in; local userpwd_in_str;
> local netdev
> @@ -517,19 +518,33 @@ kdump_setup_iscsi_device() {
>
> [ -n "$username_in" ] &&
userpwd_in_str=":$username_in:$password_in"
>
> - netdev=$(/sbin/ip route get to ${tgt_ipaddr} | \
> - sed 's|.*dev \(.*\).*|\1|g')
> + if is_ipv6_address $tgt_ipaddr; then
> + netdev=$(/sbin/ip -6 route get to $(get_remote_host $tgt_ipaddr) | \
> + sed 's|.*dev \(.*\).*|\1|g')
> + else
> + netdev=$(/sbin/ip route get to ${tgt_ipaddr} | \
> + sed 's|.*dev \(.*\).*|\1|g')
> + fi
> srcaddr=$(echo $netdev | awk '{ print $3; exit }')
> netdev=$(echo $netdev | awk '{ print $1; exit }')
>
> - kdump_setup_netdev $netdev $srcaddr $tgt_ipaddr
> + kdump_setup_netdev $netdev $srcaddr $(get_remote_host $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.
>
> -
netroot_str="netroot=iscsi:${userpwd_str}${userpwd_in_str}@$tgt_ipaddr::::$tgt_name"
> + if is_ipv6_address $tgt_ipaddr; then
> + if `echo $tgt_ipaddr | grep -q "%"`; then
> + _prefix=${tgt_ipaddr%\%*}
> + _netdev=${tgt_ipaddr#*\%}
> + _netdev=$(kdump_setup_ifname $_netdev)
> + tgt_ipaddr=$_prefix%$_netdev
> + fi
> +
netroot_str="netroot=iscsi:${userpwd_str}${userpwd_in_str}@[$tgt_ipaddr]::::$tgt_name"
> + else
> +
netroot_str="netroot=iscsi:${userpwd_str}${userpwd_in_str}@$tgt_ipaddr::::$tgt_name"
> + fi
>
> [[ -f $netroot_conf ]] || touch $netroot_conf
>
> --
> 2.2.2
>