api: ceph: mon: make checking for duplicate addresses more robust
Because $mon->{addr} might come with a port attached (affects monitors created with PVE 5.4 as reported in the community forum [0]), or even be a hostname (according to the code in Ceph/Services.pm). Although the latter shouldn't happen for configurations created by PVE. [0]: https://forum.proxmox.com/threads/105904/ Fixes: 9e989449 ("api: ceph: mon: fix handling of IPv6 addresses in assert_mon_prerequisites") Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
This commit is contained in:
parent
ea4d55c99d
commit
e6f55a13b0
@ -132,8 +132,10 @@ my $assert_mon_prerequisites = sub {
|
||||
for my $mon (values %{$monhash}) {
|
||||
next if !defined($mon->{addr});
|
||||
|
||||
my $ip = PVE::Network::canonical_ip($mon->{addr});
|
||||
$used_ips->{$ip} = 1;
|
||||
for my $ip ($ips_from_mon_host->($mon->{addr})->@*) {
|
||||
$ip = PVE::Network::canonical_ip($ip);
|
||||
$used_ips->{$ip} = 1;
|
||||
}
|
||||
}
|
||||
|
||||
for my $monip (@{$monips}) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user