On 07/24/15 at 10:19am, Dave Young wrote:
On 07/23/15 at 06:29pm, Minfei Huang wrote:
> 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 04a2e15..2a0d93f 100755
> --- a/dracut-module-setup.sh
> +++ b/dracut-module-setup.sh
> @@ -542,10 +542,12 @@ kdump_setup_iscsi_device() {
> kdump_setup_netdev $netdev $srcaddr
>
> # 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
Relooking this patch, have you really tested iscsi/ipv6?
Below part need a change for ipv6 as well:
netdev=$(/sbin/ip route get to ${tgt_ipaddr} | \
sed 's|.*dev \(.*\).*|\1|g')
srcaddr=$(echo $netdev | awk '{ print $3; exit }')
netdev=$(echo $netdev | awk '{ print $1; exit }')
kdump_setup_netdev $netdev $srcaddr
Hi, Dave.
Kdump can fetch the parameters from the iscsi session successfully using
above code with both ipv4 and ipv6 protocol.
Here are example for ipv4 and ipv6 protocol.
[root@intel-sugarbay-dh-02 99kdumpbase]# /sbin/ip route get to
2620:52:0:102f:21e:67ff:fe65:9608
2620:52:0:102f:21e:67ff:fe65:9608 from :: via fe80:52:0:13b0::7fe dev em1 src
2620:52:0:13b0:213:20ff:fef9:ad92 metric 0
cache hoplimit 64
[root@intel-sugarbay-dh-02 99kdumpbase]# /sbin/ip route get to 10.16.44.98
10.16.44.98 via 10.19.183.254 dev em1 src 10.19.176.36
cache
Thanks
Minfei