From: Fabian Ebner <f.ebner@proxmox.com>
To: pve-devel@lists.proxmox.com
Subject: [pve-devel] [PATCH storage] storage migration: insecure: improve logging
Date: Thu, 11 Feb 2021 10:42:00 +0100 [thread overview]
Message-ID: <20210211094200.20664-1-f.ebner@proxmox.com> (raw)
by including the message/error from the remote side. Some people on the forum [0]
ran into 'no tunnel IP received', but without information from the remote side
it's hard to tell why.
[0]: https://forum.proxmox.com/threads/failed-no-tunnel-ip-received.80172
Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
---
PVE/Storage.pm | 12 ++++++++++--
1 file changed, 10 insertions(+), 2 deletions(-)
diff --git a/PVE/Storage.pm b/PVE/Storage.pm
index 22a6ef1..3c03abe 100755
--- a/PVE/Storage.pm
+++ b/PVE/Storage.pm
@@ -758,8 +758,16 @@ sub storage_migrate {
or die "receive command failed: $!\n";
close($input);
- my ($ip) = <$info> =~ /^($PVE::Tools::IPRE)$/ or die "no tunnel IP received\n";
- my ($port) = <$info> =~ /^(\d+)$/ or die "no tunnel port received\n";
+ my $ip = <$info> // '';
+ chomp($ip);
+ die "no tunnel IP received, got '$ip'\n"
+ if $ip !~ /^$PVE::Tools::IPRE$/;
+
+ my $port = <$info> // '';
+ chomp($port);
+ die "no tunnel port received, got '$port'\n"
+ if $port !~ /^\d+$/;
+
my $socket = IO::Socket::IP->new(PeerHost => $ip, PeerPort => $port, Type => SOCK_STREAM)
or die "failed to connect to tunnel at $ip:$port\n";
# we won't be reading from the socket
--
2.20.1
next reply other threads:[~2021-02-11 9:42 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-02-11 9:42 Fabian Ebner [this message]
2021-02-11 9:46 ` Fabian Ebner
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20210211094200.20664-1-f.ebner@proxmox.com \
--to=f.ebner@proxmox.com \
--cc=pve-devel@lists.proxmox.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox