On 08/13/17 at 05:41pm, Ziyue Yang wrote:
When dumping to ssh via local ipv6 address, the ssh parameter
in kdump.conf is supposed to have the form like
ssh user@fe80::cc1:8bff:fe90:b95f%eth0
where "%eth0" is an existing network interface supporting ipv6.
The get_remote_host function in kdump-lib.sh currently
doesn't remove the network interface in the link local ipv6
addresses, causing the ip command in kdump_install_net
function to fail, leading to a "Bad kdump location" message.
This commit
1) makes get_remote_host function remove network interface
in ipv6 addresses if there are any to support host finding;
2) adds is_prefixed_ipv6_link_local function to detect link local
ipv6 address with 'kdump-' prefixed interface name.
Signed-off-by: Ziyue Yang <ziyang(a)redhat.com>
---
kdump-lib.sh | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/kdump-lib.sh b/kdump-lib.sh
index 3f0af91..e67b28f 100755
--- a/kdump-lib.sh
+++ b/kdump-lib.sh
@@ -312,6 +312,14 @@ is_ipv6_address()
echo $1 | grep -q ":"
}
+is_prefixed_ipv6_link_local()
+{
+ is_ipv6_address $1 && {
+ local _host_postfix=${1##*\%}
+ echo $_host_postfix | grep -q "^kdump-eth"
+ }
+}
This should belong to the other patch which use it instead of add in
this patch.
Also it should be better to add is_ipv6_link_local instead of checking
the prefix, is_ipv6_link_local is more genral, the prefix is just a
result of our internal handling.
> +
> # get ip address or hostname from nfs/ssh config value
> get_remote_host()
> {
> @@ -323,6 +331,10 @@ get_remote_host()
> _config_val=${_config_val%:/*}
> _config_val=${_config_val#[}
> _config_val=${_config_val%]}
> + # factor out network inteface segment in local ipv6 address
> + if is_ipv6_address $_config_val; then
> + _config_val=${_config_val%\%*}
> + fi
> echo $_config_val
> }
>
> --
> 2.7.4
> _______________________________________________
> kexec mailing list -- kexec(a)lists.fedoraproject.org
> To unsubscribe send an email to kexec-leave(a)lists.fedoraproject.org