From 7a52283ba033d884edb718fa14bd658550bb1e77 Mon Sep 17 00:00:00 2001 From: Daniel Hilst <392820+dhilst@users.noreply.github.com> Date: Fri, 31 Jul 2026 19:04:39 -0300 Subject: [PATCH] fix(xcat-core): skip *NOIP* NICs when building Kea DHCP reservations makedhcp using the Kea backend fails for any node whose mac table entry uses the *NOIP* sentinel to mark a secondary NIC that has no IP address (e.g. "mac1|mac2!*NOIP*|mac3!*NOIP*"). kea_node_reservations() and kea_node_reservations6() split each NIC's hostname and pass it straight to getipaddr(), so the literal string "*NOIP*" is treated as a host to resolve. It cannot resolve, and the reservation is reported as unresolved -- which aborts the whole makedhcp run, leaving the node with no Kea reservation at all and therefore no DHCP lease. This breaks provisioning on distros that use the Kea backend (e.g. EL10, which has no ISC dhcp-server): the node never gets an address and is unreachable, while the ISC backend has always handled *NOIP* and is unaffected. Skip *NOIP* NICs in both the DHCPv4 and DHCPv6 reservation builders, the same way the ISC path does -- there is no address to reserve for them. Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com> (cherry picked from commit 9125d4da3ce26a4595fa3bb2a9e716648ffb6a08) --- xCAT-server/lib/xcat/plugins/dhcp.pm | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/xCAT-server/lib/xcat/plugins/dhcp.pm b/xCAT-server/lib/xcat/plugins/dhcp.pm index 396370d9a..ccb865afa 100644 --- a/xCAT-server/lib/xcat/plugins/dhcp.pm +++ b/xCAT-server/lib/xcat/plugins/dhcp.pm @@ -3165,6 +3165,11 @@ sub kea_node_reservations my ( $mac, $hname ) = split(/!/, $mace); $hname ||= $node; next unless $mac; + # A NIC whose hostname is the *NOIP* sentinel intentionally has no IP + # (e.g. secondary interfaces in the mac table). Skip it: there is no + # address to reserve, and trying to resolve "*NOIP*" would otherwise be + # treated as an unresolved reservation. This mirrors the ISC path. + next if $hname eq '*NOIP*'; my $normalized_mac = kea_normalize_mac($mac); unless ($normalized_mac) { $callback->({ error => ["Invalid mac address $mac for $node"], errorcode => [1] }); @@ -3315,6 +3320,11 @@ sub kea_node_reservations6 my ( $mac, $hname ) = split(/!/, $mace); $hname ||= $node; next unless $mac; + # A NIC whose hostname is the *NOIP* sentinel intentionally has no IP + # (e.g. secondary interfaces in the mac table). Skip it: there is no + # address to reserve, and trying to resolve "*NOIP*" would otherwise be + # treated as an unresolved reservation. This mirrors the ISC path. + next if $hname eq '*NOIP*'; my $normalized_mac = kea_normalize_mac($mac); unless ($normalized_mac) { $callback->({ error => ["Invalid mac address $mac for $node"], errorcode => [1] });