2
0
mirror of https://github.com/xcat2/xcat-core.git synced 2026-12-04 08:07:04 +00:00

fix(xcat-core): bmcsetup reports BMC status to an invalid IPv6 host

On an IPv6 cluster, bmcsetup in Genesis sends the bmcready status to
"[2001" instead of the management node. An OpenBMC node also reports
"failed" after its IPv6 address is set correctly.

bmcsetup reads the xcatd= kernel argument again and splits it on the
first colon. For "[2001:db8::1]:3001" this gives "[2001", and bmcsetup
writes it over the XCATMASTER that doxcat exported. updateflag.awk and
allowcred.awk then get an invalid host. The OpenBMC check reads the
address back with "lan print", which shows only IPv4 parameters.

bmcsetup now reads a bracketed xcatd= value as doxcat does. The new
bmc_has_address reads an IPv6 address back with "lan6 print" on the LAN
channel, and an IPv4 address as before.

The IPv6 status tests in genesis_bmcsetup_users.bats fail without this
change.

Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
This commit is contained in:
Daniel Hilst
2026-11-10 17:38:11 -03:00
parent d2b97cc17b
commit 9eacb22dff
+23 -2
View File
@@ -151,6 +151,20 @@ function configure_ipv6_bmc() {
fi
}
#
# Function: bmc_has_address
#
# Succeed when the BMC reports the address $1. lan print shows only the IPv4
# parameters, so an IPv6 address is read with lan6 print on $LANCHAN.
#
function bmc_has_address() {
if [[ "$1" == *:* ]]; then
ipmitool lan6 print "$LANCHAN" | grep -qiF -- "$1"
else
ipmitool lan print 1 | grep $1 >/dev/null
fi
}
if ! ipmitool -V 2>/dev/null| grep "version"; then
echo "No ipmitool find, please install it first";
exit 1;
@@ -167,7 +181,14 @@ modprobe ipmi_devintf
for parm in `cat /proc/cmdline`; do
key=`echo $parm|awk -F= '{print $1}'`
if [ "$key" = "xcatd" ]; then
XCATMASTER=`echo $parm|awk -F= '{print $2}'|awk -F: '{print $1}'`
value=${parm#*=}
# An IPv6 address holds colons. doxcat reads "[<addr>]:<port>" the same way.
if [[ $value == \[*\]:* ]]; then
XCATMASTER=${value%%\]:*}
XCATMASTER=${XCATMASTER#\[}
else
XCATMASTER=${value%%:*}
fi
fi
done
@@ -565,7 +586,7 @@ if [ ! -z "$ISOPENBMC" ]; then
if [ ! -z "$XCATMASTER" ]; then
# Wait for some time for the new network setting is ready
snooze
if ipmitool lan print 1 | grep $BMCIP >/dev/null; then
if bmc_has_address "$BMCIP"; then
updateflag.awk $XCATMASTER 3002 "installstatus bmcready"
else
updateflag.awk $XCATMASTER 3002 "installstatus failed"