Hi,

On Thu, Aug 10, 2017 at 3:48 PM, Pingfan Liu <piliu@redhat.com> wrote:




----- Original Message -----
> From: "Ziyue Yang" <ziyang@redhat.com>
> To: kexec@lists.fedoraproject.org
> Cc: "Ziyue Yang" <ziyang@redhat.com>
> Sent: Thursday, August 10, 2017 3:27:19 PM
> Subject: [PATCH v4 2/2] dracut-kdump.sh: support 'kdump-' prefixed interfaces in dump_ssh
>
> This commit makes dump_ssh
> 1) add 'kdump-' prefix to ipv6 hosts with 'eth*' like
> interfaces before dumping to the host;
> 2) cancel 'StrictHostKeyChecking' for link local ipv6
> address with 'eth*' like interface names, for it's not
> possible to add 'kdump-' variants in hased known_hosts
>

So this only affect the process of dumping, not side-effect when kdump propagate, right?
yes, it's controlled by ssh and scp's arguments while dumping.


Thanks,
Pingfan

> Signed-off-by: Ziyue Yang <ziyang@redhat.com>
> ---
>  dracut-kdump.sh | 19 ++++++++++++++++++-
>  1 file changed, 18 insertions(+), 1 deletion(-)
>
> diff --git a/dracut-kdump.sh b/dracut-kdump.sh
> index b75c2a5..d0674b3 100755
> --- a/dracut-kdump.sh
> +++ b/dracut-kdump.sh
> @@ -71,10 +71,27 @@ dump_raw()
>
>  dump_ssh()
>  {
> -    local _opt="-i $1 -o BatchMode=yes -o StrictHostKeyChecking=yes"
> +    local _opt="-i $1 -o BatchMode=yes"
>      local _dir="$KDUMP_PATH/$HOST_IP-$DATEDIR"
>      local _host=$2
>
> +    # add "kdump-" prefix to network interface name for
> +    # link-local ipv6 address, and cancel HostKeyChecking
> +    # for it's not possible to add "kdump-" variants
> +    # to hashed known_hosts
> +    if [[ $_host == *":"* ]]; then
> +        local _host_prefix=${_host%\%*}
> +        local _ifname=${_host##*\%}
> +        if [[ $_ifname == "eth"* ]]; then
> +            _host="$_host_prefix%kdump-$_ifname"
> +            _opt+=" -o StrictHostKeyChecking=no"
> +        else
> +            _opt+=" -o StrictHostKeyChecking=yes"
> +        fi
> +    else
> +        _opt+=" -o StrictHostKeyChecking=yes"
> +    fi
> +
>      echo "kdump: saving to $_host:$_dir"
>
>      cat /var/lib/random-seed > /dev/urandom
> --
> 2.9.3
> _______________________________________________
> kexec mailing list -- kexec@lists.fedoraproject.org
> To unsubscribe send an email to kexec-leave@lists.fedoraproject.org
>