On 06/18/15 at 10:53am, Dave Young wrote:
On 06/13/15 at 02:51pm, Minfei Huang wrote:
> Currently kdump doesn't support ipv6 nfs/ssh dump. Due to the lastet
> version of the Internet Protocal, it is a significant feature for kdump
> to enhance to support ipv6.
>
> Following is the special config for ipv6 protocal.
>
> For ipv6 nfs dump:
> Link scope, /etc/kdump.conf should be specified like
> "nfs [fe80::5054:ff:fe48:ca80%eth0]:/mnt"
> otherwise
> "nfs [2001:db8:0:f101::2]:/mnt"
>
> For ipv6 ssh dump:
> Link scope, /etc/kdump.conf should be edited like
> "ssh root at fe80::5054:ff:fe48:ca80%eth0"
> otherwise
> "ssh root at 2001:db8:0:f101::2"
The description is general info for ipv6 support, the problem you are
solving in this patch should be covered and explained.
This patch is only for kdump_install_net() ipv6 part..
I will rewrite the commit log to explain the patch what it does.
>
> Signed-off-by: Minfei Huang <mhuang(a)redhat.com>
> ---
> dracut-module-setup.sh | 39 +++++++++++++++++++++++++--------------
> kdump-lib.sh | 13 +++++++++++++
> 2 files changed, 38 insertions(+), 14 deletions(-)
>
> diff --git a/dracut-module-setup.sh b/dracut-module-setup.sh
> index d61cc44..615455e 100755
> --- a/dracut-module-setup.sh
> +++ b/dracut-module-setup.sh
> @@ -301,24 +301,35 @@ kdump_install_net() {
> local _server _netdev _srcaddr
> local config_val="$1"
>
> - _server=`echo $config_val | sed 's/.*@//' | cut -d':' -f1`
> + _server=`get_remote_host $config_val`
>
> - _need_dns=`echo $_server|grep "[a-zA-Z]"`
> - [ -n "$_need_dns" ] && _server=`getent hosts $_server|cut
-d' ' -f1`
> + is_hostname $_server && _server=`getent ahosts $_server|cut -d'
' -f1`
>
> - _netdev=`/sbin/ip route get to $_server 2>&1`
> - [ $? != 0 ] && echo "Bad kdump location: $config_val"
&& exit 1
> + if is_ipv6_host $_server; then
> + _netdev=`/sbin/ip -6 route get to $_server 2>&1`
> + [ $? != 0 ] && echo "Bad kdump location: $config_val"
&& exit 1
Does "ip route get to hostname" works for both ip4 and ip6?
Yes, we use "ip -6" to get the ipv6 route info.
Thanks
Minfei