From d4591ee343909244e2f8acee5ce81b74edc7c85a Mon Sep 17 00:00:00 2001 From: Daniel Hilst <392820+dhilst@users.noreply.github.com> Date: Mon, 9 Nov 2026 00:42:34 -0300 Subject: [PATCH] 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> --- xCAT-server/lib/xcat/plugins/dhcp.pm | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/xCAT-server/lib/xcat/plugins/dhcp.pm b/xCAT-server/lib/xcat/plugins/dhcp.pm index 467f3aa20a..2660c31e5e 100644 --- a/xCAT-server/lib/xcat/plugins/dhcp.pm +++ b/xCAT-server/lib/xcat/plugins/dhcp.pm @@ -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