Skip to content

Commit 23456a8

Browse files
prudo1coiby
authored andcommitted
kdumpctl/test: fix fetching of status for ssh target with ipv6
When trying to fetch the status from a ssh host that is specified via its IPv6 address kdumpctl currently hangs. This is because scp requires the IPv6 address to be enclosed in brackets, i.e. [], which is not the case in kdump.conf. Fix this by copying what is done in kdump.sh in the initrd. While at it also add option -q to silence scp. Fixes: 24e7622 ("Re-introduce vmcore creation notification to kdump") Signed-off-by: Philipp Rudo <[email protected]>
1 parent 24e7622 commit 23456a8

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

kdumpctl

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1743,8 +1743,16 @@ fetch_status()
17431743
fi
17441744
_status="$_mnt/$_status"
17451745
elif is_ssh_dump_target; then
1746-
scp -i "${OPT[sshkey]}" -o BatchMode=yes \
1747-
"${OPT[_target]}:$_status" \
1746+
local _scp_address
1747+
1748+
if is_ipv6_address "${OPT[_target]}"; then
1749+
_scp_address="${OPT[_target]%@*}@[${OPT[_target]#*@}]"
1750+
else
1751+
_scp_address="${OPT[_target]}"
1752+
fi
1753+
1754+
scp -q -i "${OPT[sshkey]}" -o BatchMode=yes \
1755+
"$_scp_address:$_status" \
17481756
"$KDUMP_TMPDIR"
17491757
case "$?" in
17501758
0)

0 commit comments

Comments
 (0)