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

fix(xcat-core): a boot loader holds the reserved DHCPv6 address of its node

render_dhcp6_config wrote no expired-leases-processing block, so Kea held a
reclaimed lease for hold-reclaimed-time, which is 3600 seconds. A node boots in
stages that share one DUID and use a different IAID each. The firmware takes the
reserved address and releases it, the reclaimed lease keeps that address bound to
the IAID of the firmware, and Kea gives the Genesis image a pool address. The
image then speaks from an address xcatd cannot map to a node, and discovery
stops at "Node unassigned".

_expired_leases6 writes the block, with hold-reclaimed-time 0 and both timers at
5 seconds, so a reserved address is free again inside one boot. A caller can
override any of the three values.

Measured on xcat88-cn: the firmware released 2001:db8:188::20 and the image was
given 2001:db8:188::1003 29 seconds later. With the block in place the image was
granted ::20 and the node reached status=shell.

Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
This commit is contained in:
Daniel Hilst
2026-11-08 10:39:06 -03:00
parent 2ec9341007
commit df0ecf829d
+20
View File
@@ -127,6 +127,10 @@ sub render_dhcp6_config {
'preferred-lifetime' => _integer( _first_defined( $intent->{'preferred-lifetime'}, $intent->{preferred_lifetime}, 43200 ) ),
'valid-lifetime' => _integer( _first_defined( $intent->{'valid-lifetime'}, $intent->{valid_lifetime}, 43200 ) ),
'host-reservation-identifiers' => _first_defined( $intent->{'host-reservation-identifiers'}, [ 'duid', 'hw-address' ] ),
# A boot chain is one DUID in several stages, and each stage asks for its own IA. Kea
# holds a reclaimed lease for an hour, so the reserved address a boot loader released
# stays bound to the IAID of the loader and the next stage is given a pool address.
'expired-leases-processing' => _expired_leases6( $intent->{'expired-leases-processing'} ),
subnet6 => [ map { $self->_render_subnet6($_) } @{ _first_defined( $intent->{subnet6}, $intent->{subnets}, [] ) } ],
);
@@ -1187,6 +1191,22 @@ sub _kea_command_output {
return $output;
}
sub _expired_leases6 {
my ($override) = @_;
my %processing = (
'reclaim-timer-wait-time' => 5,
'flush-reclaimed-timer-wait-time' => 5,
'hold-reclaimed-time' => 0,
);
if ( ref($override) eq 'HASH' ) {
@processing{ keys %{$override} } = values %{$override};
}
return { map { $_ => _integer( $processing{$_} ) } keys %processing };
}
sub _first_defined {
my @values = @_;
foreach my $value (@values) {