If an user passed a hostname as ring0_addr or ring1_addr the check_ip
checked failed as it implicitly assumed IPs even if we allowed a
general address (i.e. IP or hostname) as a format for those
properties.
Fixes: #1369
Reported here: https://forum.proxmox.com/threads/34342/
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
my $check_ip = sub {
my $ip = shift;
if (defined($ip)) {
+ if (!PVE::JSONSchema::pve_verify_ip($ip, 1)) {
+ my $host = $ip;
+ eval { $ip = PVE::Network::get_ip_from_hostname($host); };
+ if ($@) {
+ &$error("cannot use '$host': $@\n") ;
+ return;
+ }
+ }
+
my $cidr = (Net::IP::ip_is_ipv6($ip)) ? "$ip/128" : "$ip/32";
my $configured_ips = PVE::Network::get_local_ip_from_cidr($cidr);