[pve-devel] [PATCH cluster] api/join: avoid using an IPv6 address as worker task ID

Thomas Lamprecht t.lamprecht at proxmox.com
Mon Jul 30 14:31:00 CEST 2018


We used the hostname of the node over which we joined a cluster as
worker ID, which is then encoded in it's task UPID - a unique ID with
encoded information, separated by colons.
While this is no problem for normal hostnames, or IPv4 addresses, the
hostname can also be an IPv6 address - which is also separated by
colons. This throws of the upid_decode method.

While the, from a user POV, best solution would probably be to
connect and query the cluster name from the join peer it is much
simpler to just omit the ID to avoid such problems.

Signed-off-by: Thomas Lamprecht <t.lamprecht at proxmox.com>
---
 data/PVE/API2/ClusterConfig.pm | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/data/PVE/API2/ClusterConfig.pm b/data/PVE/API2/ClusterConfig.pm
index 0534e6a..9ea0341 100644
--- a/data/PVE/API2/ClusterConfig.pm
+++ b/data/PVE/API2/ClusterConfig.pm
@@ -521,7 +521,7 @@ __PACKAGE__->register_method ({
 	    die $@ if $@;
 	};
 
-	return $rpcenv->fork_worker('clusterjoin', $param->{hostname},  $authuser, $worker);
+	return $rpcenv->fork_worker('clusterjoin', undef,  $authuser, $worker);
     }});
 
 
-- 
2.18.0





More information about the pve-devel mailing list