update_nics: Don't set wantip* if they're all undef

This helps keep `%config` "clean", which helps with testing and
debugging.
This commit is contained in:
Richard Hansen 2024-08-23 23:55:09 -04:00
parent 75552f80f7
commit 974bba4d93

View file

@ -1483,13 +1483,12 @@ sub update_nics {
$ip //= $ipv4 // $ipv6; $ip //= $ipv4 // $ipv6;
$ipv4 //= $ip if is_ipv4($ip); $ipv4 //= $ip if is_ipv4($ip);
$ipv6 //= $ip if is_ipv6($ip); $ipv6 //= $ip if is_ipv6($ip);
$config{$h}{'wantipv4'} = $ipv4;
$config{$h}{'wantipv6'} = $ipv6;
if (!$ipv4 && !$ipv6) { if (!$ipv4 && !$ipv6) {
warning('unable to determine IP address'); warning('unable to determine IP address');
next; next;
} }
$config{$h}{'wantipv4'} = $ipv4;
$config{$h}{'wantipv6'} = $ipv6;
next if !nic_updateable($h); next if !nic_updateable($h);
push @hosts, $h; push @hosts, $h;