2
0
mirror of https://github.com/xcat2/xcat-core.git synced 2026-08-03 07:57:00 +00:00

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 9125d4da3c)
This commit is contained in:
Daniel Hilst
2026-07-31 19:04:39 -03:00
committed by github-actions[bot]
parent 89f5d7a8b8
commit 7a52283ba0
+10
View File
@@ -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] });