mirror of
https://github.com/xcat2/xcat-core.git
synced 2026-11-21 18:02:18 +00:00
fix(xcat-core): a node with no MAC still boots its own DHCPv6 class
When sequential discovery clears mac= on a defined node, makedhcp drops the DHCPv6 reservation of the node but keeps its two per-node client classes. The classes match the DUID, so iPXE still fetches the boot script of the node, Genesis boots with that node's destiny, and no findme reaches xcatd. kea_node_boot_classes6_for_nodes now skips a node with no MAC, as kea_node_reservations6 does, so kea_sync_node_boot_classes6 removes the classes with the reservation. dhcp_dhcpv6_duid.t fails without this change. Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
This commit is contained in:
@@ -4112,12 +4112,20 @@ sub kea_node_boot_classes6_for_nodes
|
||||
my $nrents = $nrtab->getNodesAttribs( $nodes,
|
||||
[ 'tftpserver', 'netboot', 'xcatmaster', 'servicenode', 'tftpdir' ] );
|
||||
my $ntents = $nttab ? $nttab->getNodesAttribs( $nodes, ['arch'] ) : undef;
|
||||
my $mactab = xCAT::Table->new( 'mac', -create => 0 );
|
||||
my $macents = $mactab ? $mactab->getNodesAttribs( $nodes, ['mac'] ) : undef;
|
||||
my $duids = dhcp6_client_duids($nodes);
|
||||
|
||||
my @classes;
|
||||
foreach my $node (@$nodes) {
|
||||
my $nrent = $nrents && $nrents->{$node} ? $nrents->{$node}->[0] : undef;
|
||||
next unless dhcp6_chainloads($nrent);
|
||||
|
||||
# kea_node_reservations6 writes nothing for a node with no MAC, and the classes go with
|
||||
# the reservation. They match the DUID, so a node kept by its classes alone still boots
|
||||
# its own script and never sends the findme that discovery waits for.
|
||||
my $macent = $macents && $macents->{$node} ? $macents->{$node}->[0] : undef;
|
||||
next unless $macent && $macent->{mac};
|
||||
my $ntent = $ntents && $ntents->{$node} ? $ntents->{$node}->[0] : undef;
|
||||
|
||||
# Both UUID orders, because either one can be the firmware: that depends on whether the
|
||||
|
||||
Reference in New Issue
Block a user