2
0
mirror of https://github.com/xcat2/xcat-core.git synced 2026-11-20 17:32:15 +00:00

fix(xcat-core): an unknown DHCPv6 client is handed the shim twice

kea_client_classes6 built one class per client architecture, each naming the
signed iPXE shim. That answers the firmware. The shim starts iPXE, which
solicits again carrying the iPXE user class, and a client xCAT has never seen
matches no per-node class: its only match is the same architecture class, so it
is given the shim again and never fetches a kernel. The Genesis image never
runs, no findme reaches xcatd, and sequential discovery over IPv6 cannot start.
The DHCPv4 side has carried this second stage for years in
kea_xnba_network_classes, keyed on option 93.

kea_client_classes6 now also builds an iPXE second-stage class for the network,
naming the per-network script mknb writes under xcat/ipxe/nets, which carries
destiny=discover and no node name. The class is offered before the architecture
class, because Kea takes the first class that defines an option.
kea_boot_client_classes6 passes the network and its prefix length, which name
that script.

Measured on xcat88-mn: /tftpboot/xcat/ipxe/nets holds 2001:db8:188::_64.uefi and
no DHCPv6 class named it.

Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
This commit is contained in:
Daniel Hilst
2026-11-08 11:02:56 -03:00
parent 82d39637a6
commit a8d482cdb1
2 changed files with 32 additions and 1 deletions
+26
View File
@@ -101,6 +101,32 @@ sub kea_client_classes6 {
my @classes;
# The second stage, before the first. The architecture class below answers the firmware and
# hands it the shim. The shim starts iPXE, which solicits again with the iPXE user class, and
# a client xCAT has never seen matches no per-node class: its only other match is that
# architecture class, so it is handed the shim a second time and never fetches a kernel. mknb
# writes a per-network script carrying destiny=discover and no node name, and nothing else
# names it over DHCPv6. Kea takes the first class that defines an option, so this one is
# offered first.
if ( $opts{ipxe_uefi}
&& defined( $opts{net} )
&& length( $opts{net} )
&& defined( $opts{prefix} )
&& length( $opts{prefix} ) )
{
my $scripts = $class->x86_loader( method => 'ipxe' )->{scripts};
my $network_id = $opts{net} . '_' . $opts{prefix};
my $safe = $network_id;
$safe =~ s/[^A-Za-z0-9_.-]/_/g;
push @classes, {
name => "xcat-ipxe6-net-$safe$sfx",
test => dhcp6_ipxe_user_class_test()
. " and (option[61].hex == 0x0007 or option[61].hex == 0x0009)",
'option-data' =>
[ kea_bootfile_url6_option("http://$host/tftpboot/$scripts/nets/$network_id.uefi") ],
};
}
# A UEFI client is the only x86 client that solicits over DHCPv6, so the BIOS loader has no
# DHCPv6 class. Both architecture ids are in use: firmware reports 0x0007, and 0x0009 appears
# on the same machines once the loader chainloads.
+6 -1
View File
@@ -5454,8 +5454,13 @@ sub kea_boot_client_classes6
my $uri_host = xCAT::NetworkUtils->format_uri_host( $facing[1] );
return [] unless $uri_host;
# mknb names the per-network boot script after the network and its prefix length, so the
# class that offers it needs both.
my ( $netaddr, $prefixlen ) = split( m{/}, ( defined($net) ? $net : '' ), 2 );
return xCAT::DHCP::BootPolicy->kea_client_classes6(
kea_ipxe_loader_flags(), uri_host => $uri_host, suffix => $id );
kea_ipxe_loader_flags(), uri_host => $uri_host, suffix => $id,
net => $netaddr, prefix => $prefixlen );
}
# Which upstream loader files the local TFTP tree has, as the Kea class builders take them.