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

fix(xcat-core): Subiquity IPv6 netplan lets RA start DHCPv6 and drops named resolvers

_subiquity_netplan6 wrote dhcp4: false and a static address, and left accept-ra unset. A
router advertisement with the managed flag still starts DHCPv6 in systemd-networkd. The pool
address it gets has no PTR record, so xcatd refuses the completion callback and the node
boots the installer again.

The same sub filtered site.nameservers on a colon, so a resolver given as a host name was
dropped and the management node replaced it.

The netplan now carries dhcp6: false and accept-ra: false, and the resolvers come from
_ipv6_nameservers_for_node, which resolves a host name to its AAAA address as the kickstart
path already does. subiquity_ipv6_netplan.t fails without this change.

Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
This commit is contained in:
Daniel Hilst
2026-11-06 17:29:55 -03:00
parent 007ec08369
commit e628125cf9
+8 -15
View File
@@ -2072,22 +2072,15 @@ sub _subiquity_netplan6 {
$gateway = xCAT::NetworkUtils->ipv6_server_for_node($nodename, $gateway);
}
# site.nameservers holds one list for the cluster, so the node can be given the IPv4
# resolver of another network. An IPv6-only node cannot reach it, and an unreachable
# server in resolv.conf makes every lookup wait for its timeout.
#
# '<xcatmaster>' is the management node, which runs named. It is not the gateway: a
# cluster whose gateway is a separate router would be given a resolver that answers
# nothing.
my %nameservers = %{ xCAT::NetworkUtils->getNodeNameservers([$nodename]) };
my $master6 = xCAT::NetworkUtils->ipv6_server_for_node($nodename, '<xcatmaster>');
my @resolvers = grep { index($_, ':') >= 0 }
grep { defined && length }
map { $_ eq '<xcatmaster>' ? $master6 : $_ } split(/,/, $nameservers{$nodename} // '');
@resolvers = ($master6)
if !@resolvers && defined($master6) && index($master6, ':') >= 0;
my @resolvers = _ipv6_nameservers_for_node($nodename);
my @lines = ("${pad}dhcp4: false", "${pad}addresses: [$address/$prefix]");
# A router advertisement with the managed flag starts DHCPv6 in systemd-networkd even with
# dhcp6 off. The pool address it takes has no PTR record, and xcatd refuses a callback from
# an address it cannot name.
my @lines = (
"${pad}dhcp4: false", "${pad}dhcp6: false", "${pad}accept-ra: false",
"${pad}addresses: [$address/$prefix]"
);
if (defined($gateway) && length($gateway)) {
# 'to: default' rather than the deprecated gateway6, which netplan warns about and
# drops. This is the shape xcatroot already writes for a diskless IPv6 node, so the