From dd53d1bff77ea8fe2f7731832d8ba2262b05b887 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vin=C3=ADcius=20Ferr=C3=A3o?= <2031761+viniciusferrao@users.noreply.github.com> Date: Sun, 26 Apr 2026 04:36:07 -0300 Subject: [PATCH] fix: rspconfig verification fails when setting BMC IP to current value MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- xCAT-server/lib/xcat/plugins/openbmc.pm | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/xCAT-server/lib/xcat/plugins/openbmc.pm b/xCAT-server/lib/xcat/plugins/openbmc.pm index 19076b962..936c9556a 100644 --- a/xCAT-server/lib/xcat/plugins/openbmc.pm +++ b/xCAT-server/lib/xcat/plugins/openbmc.pm @@ -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; } } }