2
0
mirror of https://github.com/xcat2/xcat-core.git synced 2026-07-31 18:19:40 +00:00
Files
xcat-core/xCAT-server/lib/xcat/plugins
Vinícius Ferrão f0a879491d fix(dhcp): avoid infinite loop building IPv6 reverse zones
getzonesfornet() derives the number of reverse-zone nibbles as
$nibbs = $maskbits / 4, then decrements it once per hex nibble of the network
prefix. For a sub-nibble (not 4-bit-aligned) IPv6 mask $nibbs can go negative
before the padding loop, and `while ($nibbs)` then never terminates: it keeps
decrementing past zero while appending "0." to $rev, spinning forever and
growing the string until the process is killed.

Make the padding loop `while ($nibbs > 0)` so it can never run away, and
return early only when $nibbs is genuinely negative. $nibbs == 0 is the normal
nibble-aligned case (e.g. a /64) and must still emit its reverse zone.

Recovered from the unmerged lenovobuild branch (original 0e070cd2). The
original guarded with `$nibbs < 1`, which also dropped the valid $nibbs == 0
case and left standard /64 subnets with no reverse zone; corrected to
`$nibbs < 0` after lab validation on a real provisioning cluster.

Co-authored-by: Jarrod Johnson <10814490+jjohnson42@users.noreply.github.com>
2026-07-22 02:13:06 -03:00
..
2018-01-24 03:16:41 -05:00
2024-05-07 16:19:25 +02:00
2023-01-18 11:00:59 -05:00
2024-02-21 11:59:50 +01:00
2026-07-15 00:29:26 -03:00
2024-05-07 16:19:25 +02:00
2024-05-07 16:19:25 +02:00
2024-05-07 16:19:25 +02:00
2019-10-28 14:33:54 -04:00
2024-05-07 16:19:25 +02:00
2022-11-29 11:50:18 -05:00
2023-01-18 11:00:59 -05:00
2020-02-02 14:40:24 -05:00
2024-04-13 12:36:08 +05:30
2022-08-15 10:16:22 -04:00
2018-08-21 15:18:12 -04:00
2018-08-21 15:18:12 -04:00