mirror of
https://github.com/xcat2/xcat-core.git
synced 2026-11-20 17:32:15 +00:00
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>
This commit is contained in:
@@ -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.
|
||||
|
||||
@@ -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];
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user