From 137bb9675bcf51ae18ecd0dd5d99d3b5ca90484a Mon Sep 17 00:00:00 2001 From: Daniel Hilst <392820+dhilst@users.noreply.github.com> Date: Sat, 7 Nov 2026 19:38:18 -0300 Subject: [PATCH] fix(genesis): the xcatd= argument names the IPv4 address of an IPv6-only node my_ip_facing resolves the peer with OnlyV4, and an IPv6-only node shares the link with the management node, so the call succeeds and returns the IPv4 address. destiny.pm wrote it into the xcatd= kernel argument, so Genesis fetched its payload over IPv6 and was told to report over IPv4. The node holds no IPv4 address once the network serves no IPv4 pool, and discovery never completes. NetworkUtils gains my_ip_facing_node, which picks the family from the node and returns the same (error, value) pair as my_ip_facing, so callers read the result unchanged. destiny.pm uses it for the genesis and legacy boot command lines. xcatd_cmdline_address already brackets an IPv6 literal, so the argument reads xcatd=[2001:db8:188::1]:3001 and the port stays separable from the address. Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com> --- perl-xCAT/xCAT/NetworkUtils.pm | 32 +++++++++++++++++++++++++ xCAT-server/lib/xcat/plugins/destiny.pm | 4 +++- 2 files changed, 35 insertions(+), 1 deletion(-) diff --git a/perl-xCAT/xCAT/NetworkUtils.pm b/perl-xCAT/xCAT/NetworkUtils.pm index 8d7d6344d9..a743fb6feb 100644 --- a/perl-xCAT/xCAT/NetworkUtils.pm +++ b/perl-xCAT/xCAT/NetworkUtils.pm @@ -4576,6 +4576,38 @@ sub uri_authority { #----------------------------------------------------------------------------- +=head3 my_ip_facing_node + + Descriptions: + The address of this management node that the node can reach, chosen in the family the + node provisions in. + Arguments: + $node - the node name + Returns: + ($error, $value) - the same pair my_ip_facing returns. $error is 0 and $value the + address on success, or 1 and the reason on failure. + +=cut + +#----------------------------------------------------------------------------- +sub my_ip_facing_node +{ + my $node = shift; + if (defined($node) && $node eq __PACKAGE__) + { + $node = shift; + } + + # my_ip_facing resolves the peer with OnlyV4, and an IPv6-only node shares the link, so that + # call returns the IPv4 address instead of failing. Genesis was then told to reach xcatd over + # a family the node has no address in. + return xCAT::NetworkUtils->node_is_ipv6_only($node) + ? xCAT::NetworkUtils->my_ip_facing_family($node, 6) + : xCAT::NetworkUtils->my_ip_facing($node); +} + +#----------------------------------------------------------------------------- + =head3 xcatd_cmdline_address The authority of the xcatd= kernel argument. See uri_authority. diff --git a/xCAT-server/lib/xcat/plugins/destiny.pm b/xCAT-server/lib/xcat/plugins/destiny.pm index ee991cef0e..5750e14e30 100644 --- a/xCAT-server/lib/xcat/plugins/destiny.pm +++ b/xCAT-server/lib/xcat/plugins/destiny.pm @@ -632,8 +632,10 @@ sub setdestiny { } #if node.xcatmaster not specified, take the ip address facing the node + # In the family the node provisions in: an IPv6-only node shares the link, so + # my_ip_facing succeeds with the IPv4 address and Genesis cannot reach xcatd. unless($master){ - my @nxtsrvd = xCAT::NetworkUtils->my_ip_facing($_); + my @nxtsrvd = xCAT::NetworkUtils->my_ip_facing_node($_); unless ($nxtsrvd[0]) { $master = $nxtsrvd[1]; }