The kdump_setup_ifname function in dracut-module-setup.sh
would add 'kdump-' prefix to network interfaces with name like
'eth*', causing ssh target specified in kdump.conf invalid
while dumping process if target is link local ipv6 address
with interface name.
This commit makes kdump_setup_ifname update the ssh target
'kdump-' prefix for link local ipv6 address cases.
Signed-off-by: Ziyue Yang <ziyang(a)redhat.com>
---
dracut-module-setup.sh | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/dracut-module-setup.sh b/dracut-module-setup.sh
index ae13337..d9e0fb9 100755
--- a/dracut-module-setup.sh
+++ b/dracut-module-setup.sh
@@ -167,6 +167,18 @@ kdump_setup_ifname() {
# 'kdump-' is already persistent, this should be fine.
if [[ $1 =~ eth* ]] && [[ ! $1 =~ ^kdump-* ]]; then
_ifname="kdump-$1"
+ # add 'kdump-' prefix for link local ipv6 address
+ local _ssh_target=$(get_option_value "ssh")
+ if is_ipv6_address "$_ssh_target"; then
+ local _host_prefix=${_ssh_target%\%*}
+ local _host_postfix=${_ssh_target##*\%}
+ if [[ $_host_postfix == "eth"* ]]; then
+ _new_ssh_target="$_host_prefix%kdump-$_host_postfix"
+ #erase the old ssh target and insert the new one
+ sed -i "/^ssh\ /d" ${initdir}/tmp/$$-kdump.conf
+ echo "ssh $_new_ssh_target" >>
${initdir}/tmp/$$-kdump.conf
+ fi
+ fi
else
_ifname="$1"
fi
--
2.7.4