2
0
mirror of https://github.com/xcat2/xcat-core.git synced 2026-06-25 08:50:48 +00:00

fix: rspconfig verification fails when setting BMC IP to current value

The verification logic in rspconfig_response uses a mutually exclusive
if/else to check for the old IP (origin_type) and new IP (check_result).
When setting the same IP, both match the same entry but only origin_type
gets set — check_result stays 0 and the command reports "Config IP failed".

Make the two checks independent so both can match the same IP object.

Fixes #5121
This commit is contained in:
Vinícius Ferrão
2026-04-26 04:36:07 -03:00
parent ca8baff388
commit dd53d1bff7
+9 -10
View File
@@ -3839,17 +3839,16 @@ sub rspconfig_response {
$nic =~ s/(.*\/)//g;
$status_info{RSPCONFIG_DHCPDIS_REQUEST}{init_url} =~ s/#NIC#/$nic/g
}
} else {
if (($content{Address} eq $check_ip) and
($content{PrefixLength} eq $check_netmask) and
($content{Gateway} eq $check_gateway)) {
if ($check_vlan) {
if (defined($response_info->{data}->{$path}->{Id}) and $response_info->{data}->{$path}->{Id} eq $check_vlan) {
$check_result = 1;
}
} else {
$check_result = 1;
}
if (($content{Address} eq $check_ip) and
($content{PrefixLength} eq $check_netmask) and
($content{Gateway} eq $check_gateway)) {
if ($check_vlan) {
if (defined($response_info->{data}->{$path}->{Id}) and $response_info->{data}->{$path}->{Id} eq $check_vlan) {
$check_result = 1;
}
} else {
$check_result = 1;
}
}
}