2
0
mirror of https://github.com/xcat2/xcat-core.git synced 2026-11-21 18:02:18 +00:00

fix(xcat-core): an IPv6 master gives a Genesis node no credentials

A node discovered by Genesis on an IPv6-only cluster gets no credentials and
reports no state. The credential callback never answers and the install state
never reaches xcatd, so discovery stops with nothing in the log that names an
address family.

The Genesis copies of the two awk helpers were never given the IPv6 branch
that the copies under xCAT/postscripts carry. allowcred.awk hardcoded
"/inet/tcp/300/0/0", so it ignored XCAT_CREDENTIAL_CALLBACK_PORT and opened a
listener that accepts no IPv6 connection. updateflag.awk built "/inet/" from
the raw argument, so a bracketed IPv6 literal reached gawk with its brackets
and resolved to nothing. Neither build script copies these files, so the two
copies are independent and the first never followed the second.

Both Genesis copies now carry the postscripts logic. updateflag.awk keeps
logger and writes no file: Genesis has no /var/log/xcat directory, rsyslog
sends everything to /var/log/xcat.genesis, and gawk is fatal when it cannot
open a redirect.

ipv6_genesis_awk_inet6.bats captures this. Four of its six cases fail on the
previous copies.

Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
This commit is contained in:
Daniel Hilst
2026-11-05 09:20:22 -03:00
parent 32d45ea9e8
commit a12d31ced5
2 changed files with 44 additions and 16 deletions
+17 -3
View File
@@ -1,9 +1,23 @@
#!/usr/bin/awk -f
#
# The Genesis copy of xCAT/postscripts/allowcred.awk. A /inet/ listener on this gawk
# accepts no IPv6 connection, so an IPv6-only node got no credentials during discovery.
BEGIN {
listener = "/inet/tcp/300/0/0"
port = ("XCAT_CREDENTIAL_CALLBACK_PORT" in ENVIRON) ? ENVIRON["XCAT_CREDENTIAL_CALLBACK_PORT"] : 300
if (port !~ /^[0-9]+$/ || port < 1 || port > 65535) {
port = 300
}
master = ("MASTER_IP" in ENVIRON) ? ENVIRON["MASTER_IP"] : ""
if (master == "") {
master = ("MASTER" in ENVIRON) ? ENVIRON["MASTER"] : ""
}
if (master ~ /:/) {
listener = "/inet6/tcp/" port "/0/0"
} else {
listener = "/inet/tcp/" port "/0/0"
}
quit = "no"
while (match(quit,"no")) {
while ((listener |& getline) > 0) {
if (match($0,"CREDOKBYYOU?")) {
+27 -13
View File
@@ -1,32 +1,46 @@
#!/usr/bin/awk -f
# IBM(c) 2007 EPL license http://www.eclipse.org/legal/epl-v10.html
#
# The Genesis copy of xCAT/postscripts/updateflag.awk. It writes no file: Genesis has no
# /var/log/xcat directory, rsyslog sends everything to /var/log/xcat.genesis, and gawk is
# fatal when it cannot open a redirect.
BEGIN {
xcatdhost = ARGV[1]
xcatdport = ARGV[2]
flag = ARGV[3]
if (!flag) flag = "next"
if (!flag) flag = "next"
ns = "/inet/tcp/0/" ARGV[1] "/" xcatdport
if (xcatdhost ~ /^\[.*\]$/) {
sub(/^\[/, "", xcatdhost)
sub(/\]$/, "", xcatdhost)
}
netfamily = index(xcatdhost, ":") ? "inet6" : "inet"
ns = "/" netfamily "/tcp/0/" xcatdhost "/" xcatdport
while(1) {
if((ns |& getline) > 0)
print $0 | "logger -t xcat -p local4.info"
loop = 0
while(1) {
if((ns |& getline) > 0)
print $0 | "logger -t xcat -p local4.info"
else {
print "Retrying flag update" | "logger -t xcat -p local4.info"
close(ns)
system("sleep 10")
loop = loop + 1
}
if($0 == "ready")
print flag |& ns
if($0 == "done")
break
}
if($0 == "ready")
print flag |& ns
if($0 == "done")
break
if(loop > 10) {
print "flag update failed" | "logger -t xcat -p local4.info"
break
}
}
close(ns)
close(ns)
exit 0
exit 0
}